{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "text similarity cord-19.ipynb",
      "provenance": [],
      "authorship_tag": "ABX9TyNTRorZFfRFpzk7zCubIqUk",
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU",
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "0e402de8cf604fc0904632a3da4c33c8": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_9998d8d241204a93bd3e23e17b4b0f79",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_b0784642ad474f058c1fe8ab0ddf39dd",
              "IPY_MODEL_750471715d9945ad80248b7e8fddd735"
            ]
          }
        },
        "9998d8d241204a93bd3e23e17b4b0f79": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "b0784642ad474f058c1fe8ab0ddf39dd": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "IntProgressModel",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_f8484bfd9d07440f8b1bf2188747c786",
            "_dom_classes": [],
            "description": "100%",
            "_model_name": "IntProgressModel",
            "bar_style": "success",
            "max": 9524,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 9524,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_b8e0e28937c14b79ab8ef99adb312969"
          }
        },
        "750471715d9945ad80248b7e8fddd735": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_4838639675b445e49cdc97df15dca914",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 9524/9524 [00:40&lt;00:00, 236.66it/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_e51c1bb48c514af19d2bc02a1e297a96"
          }
        },
        "f8484bfd9d07440f8b1bf2188747c786": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "initial",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "b8e0e28937c14b79ab8ef99adb312969": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "4838639675b445e49cdc97df15dca914": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "e51c1bb48c514af19d2bc02a1e297a96": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "e5266b10473049c38b3126a696690d3b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_732b3ac301b6487aac214c9e7bd79157",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_0fac20ae6bdd42099eaaa29f799151a4",
              "IPY_MODEL_18278c00e6dc4726b369c5b2da18a1c5"
            ]
          }
        },
        "732b3ac301b6487aac214c9e7bd79157": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "0fac20ae6bdd42099eaaa29f799151a4": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "IntProgressModel",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_cd66b20c2a8b471f978b797cb87edc82",
            "_dom_classes": [],
            "description": "100%",
            "_model_name": "IntProgressModel",
            "bar_style": "success",
            "max": 2490,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 2490,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_26c15e40bdf24b1cb1b9f535a42c2b5f"
          }
        },
        "18278c00e6dc4726b369c5b2da18a1c5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_f079436097e749c3ae6b98047cdd41de",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 2490/2490 [1:01:30&lt;00:00,  1.48s/it]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_d9b2a90031ec4866b82a938fe56f0603"
          }
        },
        "cd66b20c2a8b471f978b797cb87edc82": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "initial",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "26c15e40bdf24b1cb1b9f535a42c2b5f": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "f079436097e749c3ae6b98047cdd41de": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "d9b2a90031ec4866b82a938fe56f0603": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        }
      }
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/dair-ai/covid_19_search_application/blob/master/text_similarity_cord_19.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "cSxeZmIZJ858",
        "colab_type": "text"
      },
      "source": [
        "# Text Similarity Search with Modern NLP and Elasticsearch Service\n",
        "\n",
        "![alt text](https://drive.google.com/uc?export=view&id=1p9T9oXfeRoCd6vtN_TPuUSBA4vDoeIeF)\n",
        "\n",
        "\n",
        "**Objective:** In this notebook, we will learn how to make use of modern NLP techniques to build a simple prototype of a search application. After going over this tutorial, the learner will be able to use pretrained language models to build a search application powered by an open-source tool called [Elasticsearch](https://www.elastic.co/downloads/).\n",
        "\n",
        "This project will be maintained here: https://github.com/dair-ai/covid_19_search_application\n",
        "\n",
        "If you have any questions about this tutorial or you face any issues, reach out to me on [Twitter](https://twitter.com/omarsar0). If you have any feedback or are interested to keep building on this project, please reach out either via email at ellfae@gmail.com or Twitter.\n",
        "\n",
        "Note that this tutorial is in draft mode meaning that you could encounter typos and so forth.\n",
        "\n",
        "\n",
        "\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "wq3J1_VhtUcT",
        "colab_type": "text"
      },
      "source": [
        "## Load the data from Kaggle\n",
        "- First, we need to download a datset provided on Kaggle for the [COVID-19 Open Research Dataset Challenge (CORD-19)](https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challenge). You need to create a Kaggle account to be able to download the dataset. We will use the `kaggle` client to connect to Kaggle and download the dataset to this environment. This means that you don't need to manually upload the datasets.\n",
        "- Create a Kaggle account and then create a token in your account, then download the `kaggle.json` provided. This holds your credentials that you will use to get access to the data set from here.\n",
        "- Manually upload the `kaggle.json` file to this Colab environment. Just look on the left hand side, and you will find an option to upload the file.\n",
        "- Once the file has been uploaded into this environment, you need to run the commands below:\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "0BmI8j_ltcq_",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 85
        },
        "outputId": "25e02b29-e332-4128-fbee-f974663117c9"
      },
      "source": [
        "!mkdir -p ~/.kaggle\n",
        "!cp kaggle.json ~/.kaggle/\n",
        "!kaggle datasets download -d allen-institute-for-ai/CORD-19-research-challenge"
      ],
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Warning: Your Kaggle API key is readable by other users on this system! To fix this, you can run 'chmod 600 /root/.kaggle/kaggle.json'\n",
            "Downloading CORD-19-research-challenge.zip to /content\n",
            "100% 1.47G/1.47G [00:21<00:00, 68.8MB/s]\n",
            "100% 1.47G/1.47G [00:21<00:00, 74.0MB/s]\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "bVlXq_5VMh24",
        "colab_type": "text"
      },
      "source": [
        "The commands above download the entire dataset to the environment, which you can view by clicking on the \"folder\" option on the left hand side. \n",
        "\n",
        "Unzip the files by running the command below (**note that it may take up to 5 minutes to unzip all files**):"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "OVvt4jsltxTH",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "%%capture\n",
        "## takes ~5 mins\n",
        "!unzip CORD-19-research-challenge.zip"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "IcoLqjnCvAn9",
        "colab_type": "text"
      },
      "source": [
        "## Import libraries\n",
        "We are going to use some of the common libraries like TensorFlow so we don't really need to install any libraries up to this point. "
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "XAe3XtkKwKV-",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        },
        "outputId": "a6433789-734d-4714-fdb8-f9d8713fcd4e"
      },
      "source": [
        "from tqdm.notebook import tqdm\n",
        "import os\n",
        "import json\n",
        "import pandas as pd\n",
        "import tensorflow as tf\n",
        "import tensorflow_hub as hub\n",
        "import time\n",
        "\n",
        "print(tf.__version__)"
      ],
      "execution_count": 4,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "2.2.0-rc2\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "sdPusHfWPGN4",
        "colab_type": "text"
      },
      "source": [
        "## Load the data\n",
        "We are interested in two batches of articles from the CORD-19 dataset. This amounts to over ~12000 scholarly articles "
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "fhzXBXz8t_Xb",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 115,
          "referenced_widgets": [
            "0e402de8cf604fc0904632a3da4c33c8",
            "9998d8d241204a93bd3e23e17b4b0f79",
            "b0784642ad474f058c1fe8ab0ddf39dd",
            "750471715d9945ad80248b7e8fddd735",
            "f8484bfd9d07440f8b1bf2188747c786",
            "b8e0e28937c14b79ab8ef99adb312969",
            "4838639675b445e49cdc97df15dca914",
            "e51c1bb48c514af19d2bc02a1e297a96",
            "e5266b10473049c38b3126a696690d3b",
            "732b3ac301b6487aac214c9e7bd79157",
            "0fac20ae6bdd42099eaaa29f799151a4",
            "18278c00e6dc4726b369c5b2da18a1c5",
            "cd66b20c2a8b471f978b797cb87edc82",
            "26c15e40bdf24b1cb1b9f535a42c2b5f",
            "f079436097e749c3ae6b98047cdd41de",
            "d9b2a90031ec4866b82a938fe56f0603"
          ]
        },
        "outputId": "6b70a5b9-62c1-44ab-e7bc-35e95449e74a"
      },
      "source": [
        "## Adapted from Souvik's Kaggle notebook\n",
        "## https://www.kaggle.com/souviksbhowmik/transmission-incubation-and-stability-by-souvik\n",
        "\n",
        "working_list=[]\n",
        "paths = [\"comm_use_subset/comm_use_subset/pdf_json/\", \"noncomm_use_subset/noncomm_use_subset/pdf_json/\"]\n",
        "for p in paths:\n",
        "    for file in tqdm(os.listdir(p)):\n",
        "        #print(file)\n",
        "        text_content = '' # combine title, abstract, and body text or articles\n",
        "        working_dict = dict({\"abstract\": [], \"body_text\":[]})\n",
        "        content = json.load(open(p+file,'r'))\n",
        "        #print(type(content))\n",
        "        working_dict['paper_id'] = content['paper_id']\n",
        "        working_dict['path'] = p\n",
        "        if 'metadata' in content and 'title' in content['metadata']:\n",
        "            working_dict['title'] = content['metadata']['title']\n",
        "            #print('found title')\n",
        "            text_content = text_content  +' '+ content['metadata']['title']\n",
        "        if 'abstract' in content:\n",
        "            #print('found abstract')\n",
        "            for abst in content['abstract'] :\n",
        "                text_content = text_content+' '+abst['text']\n",
        "                working_dict['abstract'].append(abst['text'])    \n",
        "        if 'body_text' in content:\n",
        "            #print('found body text')\n",
        "            for bt in content['body_text'] :\n",
        "                text_content = text_content+' '+bt['text']\n",
        "                working_dict['body_text'].append(bt['text'])\n",
        "        \n",
        "        working_dict['text'] = text_content\n",
        "        working_list.append(working_dict)"
      ],
      "execution_count": 5,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "0e402de8cf604fc0904632a3da4c33c8",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "HBox(children=(IntProgress(value=0, max=9524), HTML(value='')))"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "e5266b10473049c38b3126a696690d3b",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "HBox(children=(IntProgress(value=0, max=2490), HTML(value='')))"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "wT4m2hIQwE8t",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        },
        "outputId": "4ec5a6fa-d52a-4b9b-f44e-63e18d51409d"
      },
      "source": [
        "len(working_list)"
      ],
      "execution_count": 6,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "12014"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 6
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "aP6jHPW-PV1c",
        "colab_type": "text"
      },
      "source": [
        "Preview the articles:"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "KREasGKV4vjK",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "outputId": "e4316824-6c60-44c9-fc85-a449d0fdc6d9"
      },
      "source": [
        "working_list[0:2]"
      ],
      "execution_count": 7,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'abstract': [\"Fusion between the viral and target cell membranes is an obligatory step for the infectivity of all enveloped virus, and blocking this process is a clinically validated therapeutic strategy. Viral fusion is driven by specialized proteins which, although specific to each virus, act through a common mechanism, the formation of a complex between two heptad repeat (HR) regions. The HR regions are initially separated in an intermediate termed ''prehairpin'', which bridges the viral and cell membranes, and then fold onto each other to form a 6-helical bundle (6HB), driving the two membranes to fuse. HR-derived peptides can inhibit viral infectivity by binding to the prehairpin intermediate and preventing its transition to the 6HB. The antiviral activity of HR-derived peptides differs considerably among enveloped viruses. For weak inhibitors, potency can be increased by peptide engineering strategies, but sequence-specific optimization is time-consuming. In seeking ways to increase potency without changing the native sequence, we previously reported that attachment to the HR peptide of a cholesterol group (''cholesterol-tagging'') dramatically increases its antiviral potency, and simultaneously increases its halflife in vivo. We show here that antiviral potency may be increased by combining cholesterol-tagging with dimerization of the HR-derived sequence, using as examples human parainfluenza virus, Nipah virus, and HIV-1. Together, cholesteroltagging and dimerization may represent strategies to boost HR peptide potency to levels that in some cases may be compatible with in vivo use, possibly contributing to emergency responses to outbreaks of existing or novel viruses.\"],\n",
              "  'body_text': [\"Fusion between the viral and the target cell membrane is an obligatory step for the infectivity of all enveloped viruses. The development of compounds -peptides in particular -which block this process is a well-established therapeutic strategy [1] that has been clinically validated for the retrovirus human immunodeficiency virus type 1 (HIV-1) with the development of the peptide fusion inhibitor enfuvirtide (FuzeonH, also known as T20) [2] . Viral fusion is driven by specialized proteins which, although specific to each virus, act through a common mechanism. In particular the more prevalent ''class I'' fusion proteins harbor two heptad repeat (HR) regions which are central to the process, the first one in the N-terminal region, adjacent to the fusion peptide (HRN), and the second one in the C-terminal region, immediately preceding the transmembrane domain (HRC). The currently accepted model stipulates that once fusion is initiated by the binding of the envelope glycoprotein (gp) to its cellular receptor, the HRN and HRC regions become separated in the so-called prehairpin intermediate, which bridges the viral and cell membranes; in the prehairpin structure, HRN forms a trimeric coiled-coil. Folding of the HRC onto the HRN trimer leads to the formation of a 6-helical bundle (6HB), and in this process the two membranes are driven in close apposition, ultimately resulting in their fusion, as reviewed in [1] . In this view, inhibitors that bind to the prehairpin intermediate and prevent its transition to the 6HB inhibit viral entry. This is the case for enfuvirtide, which spans part of the HRC region of the fusogenic protein gp41 of HIV-1 [2] . The same mechanism of inhibition applies to peptides derived from the HR regions of many other viruses [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] .\",\n",
              "   'The characteristic sequence pattern of the heptad repeats, which drive formation of coiled coils, provides an important advantage for the development of peptide-based antivirals: putative HRN and HRC peptides in viral fusion proteins can be easily identified directly from genomic information, through computer programs like LearnCoil [20] or MultiCoil [21, 22] . Indeed, for the emerging coronavirus that in recent years caused the SARS outbreak [23] , identification of HRN and HRC regions [24] and development of peptide inhibitors [17, 19] preceded the determination of the structure of the fusion protein [25, 26, 27, 28] .',\n",
              "   'Therefore, in addition to being a viable strategy for known viruses, inhibition of viral fusion offers the opportunity for a rapid response to emerging viral pathogens, opening the possibility to develop a specific antiviral in very short timeframe.',\n",
              "   'However, the potency of HR-derived peptides differs considerably among enveloped viruses, with HIV being a particularly favorable case. The reasons for this difference are not fully established, although a major factor is represented by fusion kinetics. Indeed, viruses with a slower transition through the hairpin intermediate offer a longer window of opportunity for peptide inhibitors that, accordingly, show greater potency [29, 30, 31] .',\n",
              "   'Several peptide engineering strategies have been successfully applied to increase the potency of peptide fusion inhibitors [8, 32, 33, 34, 35, 36, 37] . However, they all require sequence-specific modifications, a relatively time-consuming optimization process. We have taken a different approach, seeking ways to increase antiviral activity without the need to change the native HRderived sequence.',\n",
              "   \"To this end, we have previously reported that by attaching a cholesterol group to a peptide fusion inhibitor (''cholesteroltagging'') we can dramatically increase its antiviral potency [38] . Cholesterol-tagging of C34, a peptide from the HRC domain of HIV-1 gp41, produced an inhibitor (C34-chol) that, depending on the viral strain tested, is 25-to 100-fold more potent than unconjugated C34, and 50-to 400-fold more potent than the clinical drug enfuvirtide [38] .\",\n",
              "   'We showed that this is the result of selectively enriching the peptide in the membrane, where viral fusion occurs [39, 40, 41, 42] . Cholesterol-tagging therefore appears to be a general method, applicable to many enveloped viruses.',\n",
              "   'We have recently shown that cholesterol tagging of an HRC peptide from the paramyxovirus human parainfluenza virus type 3 (HPIV3) also increased its antiviral potency [43] . Notably, this peptide maintained the ability of the unconjugated peptide to inhibit both HPIV3 and the emerging paramyxoviruses Hendra virus (HeV) and Nipah virus (NiV) [15, 44] , both fatal in humans. The cholesterol-tagged peptide now acquired the ability to also inhibit the rubulavirus SV5 (also known as PIV5) [43] . For Nipah virus, the cholesterol-tagged HRC peptide was active in vivo, effectively preventing and treating in an established animal model what would otherwise be fatal Nipah virus encephalitis [45] .',\n",
              "   'An additional advantage of cholesterol tagging is that it prolongs the half-life of the peptide in vivo, through binding to serum proteins. A pharmacokinetic (PK) study of C34-Chol in mice at the concentration of 3.5 mg/kg showed that whereas unconjugated C34 was undetectable in plasma after 6 h, 130 nM of C34-Chol was still detectable 24 h after the injection: a concentration < 300-fold higher than the IC 90 measured against multiple HIV-1 strains [38] . To further expand on the generality of our method to potentiate the activity of natural HRC peptide inhibitors, we assessed the value of dimerization of the fusion inhibitor. Several examples of the successful use of multimerization to increase the potency of fusion inhibitors [46, 47] or entry inhibitors [48] have been reported.',\n",
              "   'In the hypothesized avidity effect [49] , dimerization/multimerization works by reducing the k off of the inhibitor-fusion protein complex formation. Cholesterol tagging, on the other hand, facilitates the encounter of the peptide with the viral target protein by enriching the peptide in target membranes, an effect which increases the k on for complex formation. The two modifications could therefore work in concert, and both can be implemented without any requirement for optimization of the native sequence of the HRN/HRC peptide.',\n",
              "   'In the following, we report on our design of cholesterol-tagged dimeric fusion inhibitors, and demonstrate their efficacy in preventing or curtailing HPIV3, NiV, and HIV-1 replication in vitro and in vivo.',\n",
              "   'In designing a moiety containing the cholesterol group and the branching functionalities we incorporated the features listed below.',\n",
              "   'Firstly, we included a single cholesterol group. On one hand, given the considerable reduction of solubility from the cholesterol moiety, we wanted to avoid multiple copies of it; on the other hand, we hypothesized that the balance of cholesterol to the polypeptide moiety would still provide efficient anchoring of the multimeric inhibitor to membrane rafts. A single anchoring moiety is sufficient for proteins considerably larger in size [50] than even large copy number multimeric inhibitors with a monomer size of 35-40 amino acids. Data published after our work was completed lend further support to our hypothesis [51] . Moreover, we envisage having only two copies of the inhibitor sequence, as discussed below.',\n",
              "   'Secondly, we decided to focus on dimeric inhibitors. Findings by Kay and co-workers suggest that despite the trimeric structure of the fusion intermediate, the maximum benefit of multimerization is achieved at the level of dimer, with little -or even noadditional benefit in trimeric inhibitors [46, 47] .',\n",
              "   'Thirdly, we selected four polyethylene glycol (PEG) units as the spacer between each monomer and the cholesterol core ( Figure 1 ). This would provide approximately the same distance between monomers as that successfully used by Welch et al. [46] . Moreover, we had found a PEG 4 spacer between the peptide and cholesterol to be beneficial in monomeric fusion inhibitors [45] . Notably, in a subsequent publication Welch et al. showed that reduction of the linker length provided considerable increase in potency [47] . This is clearly an area that requires further exploration in our nextgeneration branching cores.',\n",
              "   'Fourthly, we selected maleimide as a well-established chemoselective reactive moiety to conjugate the cholesterol-containing core to the cysteine-containing peptide.',\n",
              "   'The structure of the cholesterol-containing dimeric core 9 is shown in Figure 1 . The compound is stable, and when stored at -20uC it can be used reliably for at least 12 months.',\n",
              "   'The peptides used in this study are listed in Table 1 . The dimeric cholesterol-tagged fusion inhibitors were prepared via conjugation of the cysteine-containing peptide precursors (HPIV-P1, HIV-P1) to the maleimide-functionalized core 9. We had initially considered a bromoacetyl group as the reactive moiety, as we had done for the monomeric cholesterol-tagged inhibitors [38, 43, 45] . The corresponding functionalized core was prepared as described for 9 (see Figures S1 and S2), by using in the last step bromoacetyl anhydride instead of 4-maleimido-butyric acid. However, it turned out to be difficult to control the competition between reactivity of the core with the peptide and hydrolysis of the bromoacetyl group, leading to a difficult-to-separate mixture of dimeric and momomeric/capped conjugates. Using maleimide instead as the reactive moiety, the reaction was straightforward, and it proceeded rapidly in good overall yield.',\n",
              "   'We initially focused on HPIV3 and NiV. These viruses represent major unmet medical needs [52, 53] , and our previous finding that the HRC peptide derived from the sequence of HPIV3 is effective on both HPIV3 and NiV [15, 44] raised the possibility of developing a single inhibitor for both. Moreover, cholesterol-tagging of this peptide considerably improved its antiviral potency on both viruses [43] . However, the cholesteroltagged inhibitor was not yet potent enough since it required sequence optimization to display activity in vivo [45] . This sequence therefore offered an ideal opportunity to test if dimerization coupled to cholesterol-tagging could provide further potency enhancement in comparison with cholesterol-tagging alone.',\n",
              "   'We have recently shown that peptide efficacy in vivo is directly correlated with inhibition of viral fusion and cell-to-cell spreading. Peptide inhibitors able to inhibit viral entry but inefficient at blocking cell-to-cell fusion were not effective in the natural host [45, 54] . Based on these data we decided to use a cell-to-cell fusion assay using cells co-expressing the envelope viral glycoproteins of HPIV3 ( Figure 2 ) and NiV ( Figure 3 ) which is our most stringent in vitro assay to evaluate peptide efficacy Figure 2 shows a comparison of the fusion inhibitory activity for HPIV3, of the cholesterol-tagged monomer HPIV-P3 and the cholesterol-tagged dimer HPIV-P4, derived from the same peptide sequence; for comparison, we also show the fusion inhibitory activity of the native, untagged peptide inhibitor HPIV-P2, and of a control peptide dimerized via a PEG 11 linker, HPIV-P5, similar to the one used by Welch et al. [46] .',\n",
              "   'The cholesterol-tagged dimer is considerably more potent than the cholesterol-tagged monomer, which in turn is < 10-fold more potent than the untagged inhibitor. Notably, in this case no advantage is observed for dimerization alone, which exerts a positive effect only in the presence of the cholesterol moiety.',\n",
              "   'Encouraged by these data, we tested the cholesterol-tagged dimer for NiV: the HPIV3-derived HRC peptide is more active on this virus [15, 44] . Figure 3 shows a comparison of the fusion inhibitory activity on NiV fusion of the monomeric fusion inhibitor HPIV-P2 [44] , the monomeric cholesterol-tagged inhibitor HPIV-P3 [43] , the dimeric inhibitor HPIV-P5, and the dimeric cholesterol-tagged inhibitor HPIV-P4. Also in this case, the dimeric-cholesterol tagged inhibitor is < 10-fold more potent In these experiments, there is progress from the native HRC sequence to more and more potent inhibitors, without the need for extensive sequence optimization. A relatively weak fusion inhibitor (IC 50 .100 nM) is turned into a reasonably potent peptide (IC 50 between 10-100 nM for HPIV3, between 1-10 nM for NiV) and then into a potent inhibitor (IC 50 ,10 nM for HPIV3, IC 50 ,1 nM for NiV).',\n",
              "   'We confirmed the in vitro efficacy using NiV live virus in plaque reduction assays and we found that the IC 50 values are 8.0260.66 nM for the cholesterol tagged monomer and 4.3661.3 nM for the cholesterol tagged dimer. As we have previously shown for HPIV3 [45] the cholesterol tagged peptides are highly effective at blocking viral entry and the increased potency due to dimerization could be appreciated in the cell-to-cell fusion assay of figure 2 and 3.',\n",
              "   'We then turned our attention to HIV-1. In this regard, we were facing the opposite end of the spectrum in terms of potency enhancement, since the native HRC peptide is already a potent fusion inhibitor, and the potency of the cholesterol-tagged peptide is in the picomolar range [38] . Moreover, access to the gp41 prehairpin intermediate appears to be sterically restricted, with limited access to large proteins [55, 56, 57] , which would eliminate the potential beneficial effects of multimerization.',\n",
              "   'We compared the inhibitory activity on HIV-1 infectivity of the untagged fusion inhibitor HIV-P2, the monomeric cholesteroltagged inhibitor HIV-P3 [38] , the dimeric cholesterol-tagged inhibitor HIV-P4, and the corresponding dimer without the cholesterol tag, HIV-P5. Two strains of HIV-1 were used, the CCR5 coreceptor-tropic (R5) strain BaL and the CXCR4 coreptor-tropic (X4) strain LAI/IIIB, as shown in Figure 4 .',\n",
              "   'The cholesterol-tagged dimer is an extremely potent inhibitor of both the IIIB and BaL strains, with IC 50 = 2106370 pM and 10610 pM, respectively; the potency increase versus the untagged HR-derived peptide is 150-fold and 6,000-fold on the two strains (IC 50 for HIV-P2 = 31.12636 nM and 60.14684 nM on IIIB and BaL). The monomeric cholesterol-tagged inhibitor is comparably potent, with IC 50 = 80670 pM and 3606330 pM on IIIB and BaL.',\n",
              "   \"The comparable potency of the cholesterol-tagged monomer and dimer suggest that we have reached the previously identified potency plateau for very high-affinity inhibitors, where an increase in the stability of the 6HB formed by the peptide does not translate into higher antiviral potency [32, 46, 47] . Kay and co-workers have shown that for inhibitors reaching beyond this threshold, the extra-affinity can represent a ''resistance capacitor'', i.e. a reserve of binding energy that counteracts the onset of resistance due to affinity-disrupting mutations [46, 47] . We are currently investigating whether this is the case for the cholesterol-tagged HIV dimeric inhibitors.\",\n",
              "   'Based on these data, we selected the HPIV/NiV inhibitor for in vivo testing. We have previously shown that golden hamsters are a suitable small animal model for NiV infection [45] , since they develop CNS manifestations of disease similar to the human disease, unlike the cat [58] or the ferret [59] , which develop primarily respiratory disease.',\n",
              "   'The efficacy of HPIV-P4 was investigated by administering the peptide to golden hamsters intraperitoneally concurrently with virus infection, at the dose of 2 mg/kg. Injections of the peptide were then repeated every day for up to 14 days post-infection. Hamsters were infected by intraperitoneal inoculation of NiV, using 500x the LD 50 . The infected hamsters were observed daily for clinical signs (prostration, neurological signs) and variations in temperature and weight. All the untreated animals were euthanized within 7 days after infection due to neurological disease ( Figure 5 ). Treatment with the peptide resulted in survival of one of the five animals, while the onset of the illness was considerably delayed in the other four, leading to a significantly extended lifespan ( Figure 5 ). This in vivo activity provides the proof of concept for anti-viral efficacy of dimerized, cholesterol-tagged peptides. Injection of the peptide in the absence of virus challenge did not result in any apparent toxicity, with all the animals in the mock-infected group being healthy at the end of the observation period ( Figure 5 ).',\n",
              "   'In conclusion, we have shown that dimerization of an HRCderived fusion inhibitory peptide in conjunction with cholesterol tagging may be a general strategy for increasing its antiviral potency in vitro, and that dimers can be effective in vivo. This observation complements our previous reports on cholesteroltagging of fusion inhibitors [38, 43, 45, 60, 61] .',\n",
              "   'We envisage several areas of improvement over the current inhibitor series. Optimization of the length of the linker joining the monomers may provide considerable increase in potency [49] , as specifically demonstrated for HIV by the work of Kay and coworkers [47] . Using the synthetic scheme shown in Figures S1, S2 , maleimide-functionalized cores with PEG spacers of different length can be easily prepared, and they can all be reacted with the same precursor to rapidly select the most potent inhibitor. Also, although we focused on dimeric peptides, trimeric or higher copy number cores may provide an advantage, especially when the starting HRC inhibitor is weak. Finally, other chemoselective pairs may prove superior in terms of reactivity and yield over the maleimide-cysteine pair. It should be noted however, that the latter pair offers a safety advantage, since it is featured in an antibody-drug conjugate recently approved for human use (ADCETRISH, Seattle Genetics).',\n",
              "   'At this stage, cholesterol-tagging and dimerization represent feasible strategies for boosting the inhibitory potency to levels that, in some cases, may be compatible with in vivo use, without the need for extensive sequence optimization. With the availability of the necessary building blocks, synthesis of cholesterol-tagged monomers and dimers is easily and rapidly accomplished from the same precursor peptide. As such, this strategy may contribute to emergency responses to outbreaks of existing or novel viruses. The activity in vivo of a dimeric cholesterol-tagged inhibitor of NiV supports the potential utility of this strategy. We are currently exploring the scope of this approach on several enveloped viruses.',\n",
              "   'The synthesis of the cholesterol-containing branching core (Table 1) has already been described [38, 43] . Chemoselective conjugation between the Cys-peptide precursors HPIV-P1 and HIV-P1 and the cholesterol derivative 9, to yield conjugates HPIV-P4 and HIV-P4 (Table 1) is detailed in the Figures S1 and S2.',\n",
              "   'Nipah virus (isolate UMMC1; GenBank AY029767) [62] was prepared on Vero-E6 cells as described previously [63] in biosafety level 4 (BSL-4) laboratory Jean Merieux in Lyon, France. ',\n",
              "   'The assays to measure Peptide inhibition of viral entry or viral infectivity were performed as previously described [38, 43, 45] . A brief description of the assays is given below.',\n",
              "   \"Antiviral activity against live Nipah virus. In the plaque reduction assay, serial dilutions of peptides in Dulbecco's modified Eagle's medium (DMEM) (Invitrogen) were added to reporter cell monolayers of Vero E6 cells (in 12well-plates, 5.10 5 cells/well) for 1h at 37uC, 5% CO 2 . Then, 200 pfus of NiV were added to the supernatant of the Vero cells and incubated for 1h at 37uC. Supernatants were then replaced by 2ml of 1.6% of Carboxymethylcellulose in DMEM containing 3% of FCS. Plates were incubated for 4 days at 37uC, 5% CO 2 . Plates were finally revealed as a classic central plaque assay, as previously described in Guillaume et al 2004 (REF) . IC 50 were calculated using Graph Pad Prism4 software. Data were expressed as mean6standard deviation (SD).\",\n",
              "   'Antiviral activity against HIV-1 in TZM-bl cells. The TZM-bl cell line is an epithelial HeLa-derived cell line engineered to express CD4, CCR5, CXCR4 and integrated reporter genes for firefly luciferase (Luc) and E.coli b-gal under the control of an HIV-1 LTR that is transactivated by the Tat protein synthesized after infection [4] . Cells were seeded into 96-well flat bottomed plastic plates (Falcon, Becton Dickinson Labware, Lincoln Park, NJ) at 1610 4 cells/well and were incubated in the presence or absence of the compounds at 37uC for 1 h in a total volume of 50 ml. Aliquots of CCR5-dependent (R5) HIV-1 Bal or CXCR4dependent (X4) HIV-1 LAI/IIIB viral stocks at the multiplicity of infection (moi) of 4 were then added to a total volume of 100 ml in culture medium containing 15 mg/ml DEAE-dextran (Sigma-Aldrich, St. Louis, MO). Forty-eight h later, the efficiency of virus infection was determined as relative Luc units (RLU) by Luciferase assay system (Promega, Madison, WI). Antiviral activity against HIV-1 in activated peripheral blood mononuclear cells (PBMC). PBMC were isolated from blood obtained at the New York Blood Center, then cultured in RPMI 1640 supplemented with 10% FBS, 10 mM L-glutamine (Cellgro), and 100 U/ml IL-2 (ARRRP, contributed by Hoffman-LaRoche, Inc -Culture Medium). Half the PBMC culture was stimulated with 5 mg/ml of phytohemagglutinin (PHA; Sigma, St. Louis, MO), half with an anti-CD3 mAb (supernatant from the OKT3 hybridoma) in Culture Medium, directly after isolation. After 3 days, the differently stimulated cells were mixed in equal proportions, washed, and suspended in Culture Medium supplemented with 100 mg/ml of penicillin/streptomycin for the remainder of the culture. The PBMC were seeded at 1.4610 6 cells/ml in 100 ml per well in 96-well plates before addition of a serially diluted inhibitor immediately prior to inoculation with the test virus. HIV-1 replication was measured using an in-house p24 Gag antigen ELISA after 7 days of culture. Residual p24 Gag from the input virus in 4 replicates per assay was measured and subtracted. Net p24 Gag production in the test wells was compared with that in the control wells (no inhibitor in 12 replicates/assay, defined as 100%). The inhibitors were titrated in 5-fold steps and each culture well, mixed cells and supernatant, was analyzed. Two assay replicates per condition were combined in the ELISA, e.g. 12 assay 100% viral growth control wells (see above) were combined to 6 ELISA wells.',\n",
              "   'We adapted an assay [64] that detects early stages of fusion activation, since the read-out does not depend upon downstream transactivation events. We used this assay for experiments in which the greater range of detection of this assay was necessary. The assay is based on alpha complementation of beta-gal; the beta-gal protein lacking the N-terminal 85 residues (omega peptide) is expressed from one plasmid, and the N-terminal 85 residues (alpha peptide) is expressed from a second plasmid. Cell fusion leads to complementation, and beta-galactosidase is quantitated using the Galacto-Star (Applied Biosystems) chemiluminescent reporter gene assay system. Receptor bearing cells expressing the omega peptide are mixed with viral glycoproteins co-expressing cells that also express the alpha peptide, at various temperatures and at specific time points. Fusion is stopped by lysing the cells with lysis buffer. Fusion inhibitory peptides are added when the two set of cells are mixed together.',\n",
              "   'Eight-week-old golden hamsters (Mesocricetus auratus, Janvier, France) were anesthetized and infected intraperitoneally (i.p.) with 0.4 mL of NiV in a BSL-4 laboratory. Groups of 5 animals were treated daily by i.p injections of peptide (2 mg/kg) for 10 days, starting from the day of infection, or left untreated. The animals were followed daily for 3 weeks. For comparison of survival curves, Chi 2 analysis was performed using test using Graph Pad Prism4 program.',\n",
              "   \"All animals were handled in strict accordance with good animal practice as defined by the French national charter on the ethics of animal experimentation and all efforts were made to minimize suffering. Animal work was approved by the Regional ethical committee (Comité Ethique pour l'Experimentation Animal, CECCAPP, protocol P4_2010_008) and experiments were performed in the INSERM Jean Mérieux BSL-4 laboratory in Lyon, France (French Animal regulation committee Nu B69 387 05 02). \"],\n",
              "  'paper_id': 'c916747a33f9b4a986dd0e4a4b853db6814b74f9',\n",
              "  'path': 'comm_use_subset/comm_use_subset/pdf_json/',\n",
              "  'text': \" A General Strategy to Endow Natural Fusion-protein- Derived Peptides with Potent Antiviral Activity Fusion between the viral and target cell membranes is an obligatory step for the infectivity of all enveloped virus, and blocking this process is a clinically validated therapeutic strategy. Viral fusion is driven by specialized proteins which, although specific to each virus, act through a common mechanism, the formation of a complex between two heptad repeat (HR) regions. The HR regions are initially separated in an intermediate termed ''prehairpin'', which bridges the viral and cell membranes, and then fold onto each other to form a 6-helical bundle (6HB), driving the two membranes to fuse. HR-derived peptides can inhibit viral infectivity by binding to the prehairpin intermediate and preventing its transition to the 6HB. The antiviral activity of HR-derived peptides differs considerably among enveloped viruses. For weak inhibitors, potency can be increased by peptide engineering strategies, but sequence-specific optimization is time-consuming. In seeking ways to increase potency without changing the native sequence, we previously reported that attachment to the HR peptide of a cholesterol group (''cholesterol-tagging'') dramatically increases its antiviral potency, and simultaneously increases its halflife in vivo. We show here that antiviral potency may be increased by combining cholesterol-tagging with dimerization of the HR-derived sequence, using as examples human parainfluenza virus, Nipah virus, and HIV-1. Together, cholesteroltagging and dimerization may represent strategies to boost HR peptide potency to levels that in some cases may be compatible with in vivo use, possibly contributing to emergency responses to outbreaks of existing or novel viruses. Fusion between the viral and the target cell membrane is an obligatory step for the infectivity of all enveloped viruses. The development of compounds -peptides in particular -which block this process is a well-established therapeutic strategy [1] that has been clinically validated for the retrovirus human immunodeficiency virus type 1 (HIV-1) with the development of the peptide fusion inhibitor enfuvirtide (FuzeonH, also known as T20) [2] . Viral fusion is driven by specialized proteins which, although specific to each virus, act through a common mechanism. In particular the more prevalent ''class I'' fusion proteins harbor two heptad repeat (HR) regions which are central to the process, the first one in the N-terminal region, adjacent to the fusion peptide (HRN), and the second one in the C-terminal region, immediately preceding the transmembrane domain (HRC). The currently accepted model stipulates that once fusion is initiated by the binding of the envelope glycoprotein (gp) to its cellular receptor, the HRN and HRC regions become separated in the so-called prehairpin intermediate, which bridges the viral and cell membranes; in the prehairpin structure, HRN forms a trimeric coiled-coil. Folding of the HRC onto the HRN trimer leads to the formation of a 6-helical bundle (6HB), and in this process the two membranes are driven in close apposition, ultimately resulting in their fusion, as reviewed in [1] . In this view, inhibitors that bind to the prehairpin intermediate and prevent its transition to the 6HB inhibit viral entry. This is the case for enfuvirtide, which spans part of the HRC region of the fusogenic protein gp41 of HIV-1 [2] . The same mechanism of inhibition applies to peptides derived from the HR regions of many other viruses [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] . The characteristic sequence pattern of the heptad repeats, which drive formation of coiled coils, provides an important advantage for the development of peptide-based antivirals: putative HRN and HRC peptides in viral fusion proteins can be easily identified directly from genomic information, through computer programs like LearnCoil [20] or MultiCoil [21, 22] . Indeed, for the emerging coronavirus that in recent years caused the SARS outbreak [23] , identification of HRN and HRC regions [24] and development of peptide inhibitors [17, 19] preceded the determination of the structure of the fusion protein [25, 26, 27, 28] . Therefore, in addition to being a viable strategy for known viruses, inhibition of viral fusion offers the opportunity for a rapid response to emerging viral pathogens, opening the possibility to develop a specific antiviral in very short timeframe. However, the potency of HR-derived peptides differs considerably among enveloped viruses, with HIV being a particularly favorable case. The reasons for this difference are not fully established, although a major factor is represented by fusion kinetics. Indeed, viruses with a slower transition through the hairpin intermediate offer a longer window of opportunity for peptide inhibitors that, accordingly, show greater potency [29, 30, 31] . Several peptide engineering strategies have been successfully applied to increase the potency of peptide fusion inhibitors [8, 32, 33, 34, 35, 36, 37] . However, they all require sequence-specific modifications, a relatively time-consuming optimization process. We have taken a different approach, seeking ways to increase antiviral activity without the need to change the native HRderived sequence. To this end, we have previously reported that by attaching a cholesterol group to a peptide fusion inhibitor (''cholesteroltagging'') we can dramatically increase its antiviral potency [38] . Cholesterol-tagging of C34, a peptide from the HRC domain of HIV-1 gp41, produced an inhibitor (C34-chol) that, depending on the viral strain tested, is 25-to 100-fold more potent than unconjugated C34, and 50-to 400-fold more potent than the clinical drug enfuvirtide [38] . We showed that this is the result of selectively enriching the peptide in the membrane, where viral fusion occurs [39, 40, 41, 42] . Cholesterol-tagging therefore appears to be a general method, applicable to many enveloped viruses. We have recently shown that cholesterol tagging of an HRC peptide from the paramyxovirus human parainfluenza virus type 3 (HPIV3) also increased its antiviral potency [43] . Notably, this peptide maintained the ability of the unconjugated peptide to inhibit both HPIV3 and the emerging paramyxoviruses Hendra virus (HeV) and Nipah virus (NiV) [15, 44] , both fatal in humans. The cholesterol-tagged peptide now acquired the ability to also inhibit the rubulavirus SV5 (also known as PIV5) [43] . For Nipah virus, the cholesterol-tagged HRC peptide was active in vivo, effectively preventing and treating in an established animal model what would otherwise be fatal Nipah virus encephalitis [45] . An additional advantage of cholesterol tagging is that it prolongs the half-life of the peptide in vivo, through binding to serum proteins. A pharmacokinetic (PK) study of C34-Chol in mice at the concentration of 3.5 mg/kg showed that whereas unconjugated C34 was undetectable in plasma after 6 h, 130 nM of C34-Chol was still detectable 24 h after the injection: a concentration < 300-fold higher than the IC 90 measured against multiple HIV-1 strains [38] . To further expand on the generality of our method to potentiate the activity of natural HRC peptide inhibitors, we assessed the value of dimerization of the fusion inhibitor. Several examples of the successful use of multimerization to increase the potency of fusion inhibitors [46, 47] or entry inhibitors [48] have been reported. In the hypothesized avidity effect [49] , dimerization/multimerization works by reducing the k off of the inhibitor-fusion protein complex formation. Cholesterol tagging, on the other hand, facilitates the encounter of the peptide with the viral target protein by enriching the peptide in target membranes, an effect which increases the k on for complex formation. The two modifications could therefore work in concert, and both can be implemented without any requirement for optimization of the native sequence of the HRN/HRC peptide. In the following, we report on our design of cholesterol-tagged dimeric fusion inhibitors, and demonstrate their efficacy in preventing or curtailing HPIV3, NiV, and HIV-1 replication in vitro and in vivo. In designing a moiety containing the cholesterol group and the branching functionalities we incorporated the features listed below. Firstly, we included a single cholesterol group. On one hand, given the considerable reduction of solubility from the cholesterol moiety, we wanted to avoid multiple copies of it; on the other hand, we hypothesized that the balance of cholesterol to the polypeptide moiety would still provide efficient anchoring of the multimeric inhibitor to membrane rafts. A single anchoring moiety is sufficient for proteins considerably larger in size [50] than even large copy number multimeric inhibitors with a monomer size of 35-40 amino acids. Data published after our work was completed lend further support to our hypothesis [51] . Moreover, we envisage having only two copies of the inhibitor sequence, as discussed below. Secondly, we decided to focus on dimeric inhibitors. Findings by Kay and co-workers suggest that despite the trimeric structure of the fusion intermediate, the maximum benefit of multimerization is achieved at the level of dimer, with little -or even noadditional benefit in trimeric inhibitors [46, 47] . Thirdly, we selected four polyethylene glycol (PEG) units as the spacer between each monomer and the cholesterol core ( Figure 1 ). This would provide approximately the same distance between monomers as that successfully used by Welch et al. [46] . Moreover, we had found a PEG 4 spacer between the peptide and cholesterol to be beneficial in monomeric fusion inhibitors [45] . Notably, in a subsequent publication Welch et al. showed that reduction of the linker length provided considerable increase in potency [47] . This is clearly an area that requires further exploration in our nextgeneration branching cores. Fourthly, we selected maleimide as a well-established chemoselective reactive moiety to conjugate the cholesterol-containing core to the cysteine-containing peptide. The structure of the cholesterol-containing dimeric core 9 is shown in Figure 1 . The compound is stable, and when stored at -20uC it can be used reliably for at least 12 months. The peptides used in this study are listed in Table 1 . The dimeric cholesterol-tagged fusion inhibitors were prepared via conjugation of the cysteine-containing peptide precursors (HPIV-P1, HIV-P1) to the maleimide-functionalized core 9. We had initially considered a bromoacetyl group as the reactive moiety, as we had done for the monomeric cholesterol-tagged inhibitors [38, 43, 45] . The corresponding functionalized core was prepared as described for 9 (see Figures S1 and S2), by using in the last step bromoacetyl anhydride instead of 4-maleimido-butyric acid. However, it turned out to be difficult to control the competition between reactivity of the core with the peptide and hydrolysis of the bromoacetyl group, leading to a difficult-to-separate mixture of dimeric and momomeric/capped conjugates. Using maleimide instead as the reactive moiety, the reaction was straightforward, and it proceeded rapidly in good overall yield. We initially focused on HPIV3 and NiV. These viruses represent major unmet medical needs [52, 53] , and our previous finding that the HRC peptide derived from the sequence of HPIV3 is effective on both HPIV3 and NiV [15, 44] raised the possibility of developing a single inhibitor for both. Moreover, cholesterol-tagging of this peptide considerably improved its antiviral potency on both viruses [43] . However, the cholesteroltagged inhibitor was not yet potent enough since it required sequence optimization to display activity in vivo [45] . This sequence therefore offered an ideal opportunity to test if dimerization coupled to cholesterol-tagging could provide further potency enhancement in comparison with cholesterol-tagging alone. We have recently shown that peptide efficacy in vivo is directly correlated with inhibition of viral fusion and cell-to-cell spreading. Peptide inhibitors able to inhibit viral entry but inefficient at blocking cell-to-cell fusion were not effective in the natural host [45, 54] . Based on these data we decided to use a cell-to-cell fusion assay using cells co-expressing the envelope viral glycoproteins of HPIV3 ( Figure 2 ) and NiV ( Figure 3 ) which is our most stringent in vitro assay to evaluate peptide efficacy Figure 2 shows a comparison of the fusion inhibitory activity for HPIV3, of the cholesterol-tagged monomer HPIV-P3 and the cholesterol-tagged dimer HPIV-P4, derived from the same peptide sequence; for comparison, we also show the fusion inhibitory activity of the native, untagged peptide inhibitor HPIV-P2, and of a control peptide dimerized via a PEG 11 linker, HPIV-P5, similar to the one used by Welch et al. [46] . The cholesterol-tagged dimer is considerably more potent than the cholesterol-tagged monomer, which in turn is < 10-fold more potent than the untagged inhibitor. Notably, in this case no advantage is observed for dimerization alone, which exerts a positive effect only in the presence of the cholesterol moiety. Encouraged by these data, we tested the cholesterol-tagged dimer for NiV: the HPIV3-derived HRC peptide is more active on this virus [15, 44] . Figure 3 shows a comparison of the fusion inhibitory activity on NiV fusion of the monomeric fusion inhibitor HPIV-P2 [44] , the monomeric cholesterol-tagged inhibitor HPIV-P3 [43] , the dimeric inhibitor HPIV-P5, and the dimeric cholesterol-tagged inhibitor HPIV-P4. Also in this case, the dimeric-cholesterol tagged inhibitor is < 10-fold more potent In these experiments, there is progress from the native HRC sequence to more and more potent inhibitors, without the need for extensive sequence optimization. A relatively weak fusion inhibitor (IC 50 .100 nM) is turned into a reasonably potent peptide (IC 50 between 10-100 nM for HPIV3, between 1-10 nM for NiV) and then into a potent inhibitor (IC 50 ,10 nM for HPIV3, IC 50 ,1 nM for NiV). We confirmed the in vitro efficacy using NiV live virus in plaque reduction assays and we found that the IC 50 values are 8.0260.66 nM for the cholesterol tagged monomer and 4.3661.3 nM for the cholesterol tagged dimer. As we have previously shown for HPIV3 [45] the cholesterol tagged peptides are highly effective at blocking viral entry and the increased potency due to dimerization could be appreciated in the cell-to-cell fusion assay of figure 2 and 3. We then turned our attention to HIV-1. In this regard, we were facing the opposite end of the spectrum in terms of potency enhancement, since the native HRC peptide is already a potent fusion inhibitor, and the potency of the cholesterol-tagged peptide is in the picomolar range [38] . Moreover, access to the gp41 prehairpin intermediate appears to be sterically restricted, with limited access to large proteins [55, 56, 57] , which would eliminate the potential beneficial effects of multimerization. We compared the inhibitory activity on HIV-1 infectivity of the untagged fusion inhibitor HIV-P2, the monomeric cholesteroltagged inhibitor HIV-P3 [38] , the dimeric cholesterol-tagged inhibitor HIV-P4, and the corresponding dimer without the cholesterol tag, HIV-P5. Two strains of HIV-1 were used, the CCR5 coreceptor-tropic (R5) strain BaL and the CXCR4 coreptor-tropic (X4) strain LAI/IIIB, as shown in Figure 4 . The cholesterol-tagged dimer is an extremely potent inhibitor of both the IIIB and BaL strains, with IC 50 = 2106370 pM and 10610 pM, respectively; the potency increase versus the untagged HR-derived peptide is 150-fold and 6,000-fold on the two strains (IC 50 for HIV-P2 = 31.12636 nM and 60.14684 nM on IIIB and BaL). The monomeric cholesterol-tagged inhibitor is comparably potent, with IC 50 = 80670 pM and 3606330 pM on IIIB and BaL. The comparable potency of the cholesterol-tagged monomer and dimer suggest that we have reached the previously identified potency plateau for very high-affinity inhibitors, where an increase in the stability of the 6HB formed by the peptide does not translate into higher antiviral potency [32, 46, 47] . Kay and co-workers have shown that for inhibitors reaching beyond this threshold, the extra-affinity can represent a ''resistance capacitor'', i.e. a reserve of binding energy that counteracts the onset of resistance due to affinity-disrupting mutations [46, 47] . We are currently investigating whether this is the case for the cholesterol-tagged HIV dimeric inhibitors. Based on these data, we selected the HPIV/NiV inhibitor for in vivo testing. We have previously shown that golden hamsters are a suitable small animal model for NiV infection [45] , since they develop CNS manifestations of disease similar to the human disease, unlike the cat [58] or the ferret [59] , which develop primarily respiratory disease. The efficacy of HPIV-P4 was investigated by administering the peptide to golden hamsters intraperitoneally concurrently with virus infection, at the dose of 2 mg/kg. Injections of the peptide were then repeated every day for up to 14 days post-infection. Hamsters were infected by intraperitoneal inoculation of NiV, using 500x the LD 50 . The infected hamsters were observed daily for clinical signs (prostration, neurological signs) and variations in temperature and weight. All the untreated animals were euthanized within 7 days after infection due to neurological disease ( Figure 5 ). Treatment with the peptide resulted in survival of one of the five animals, while the onset of the illness was considerably delayed in the other four, leading to a significantly extended lifespan ( Figure 5 ). This in vivo activity provides the proof of concept for anti-viral efficacy of dimerized, cholesterol-tagged peptides. Injection of the peptide in the absence of virus challenge did not result in any apparent toxicity, with all the animals in the mock-infected group being healthy at the end of the observation period ( Figure 5 ). In conclusion, we have shown that dimerization of an HRCderived fusion inhibitory peptide in conjunction with cholesterol tagging may be a general strategy for increasing its antiviral potency in vitro, and that dimers can be effective in vivo. This observation complements our previous reports on cholesteroltagging of fusion inhibitors [38, 43, 45, 60, 61] . We envisage several areas of improvement over the current inhibitor series. Optimization of the length of the linker joining the monomers may provide considerable increase in potency [49] , as specifically demonstrated for HIV by the work of Kay and coworkers [47] . Using the synthetic scheme shown in Figures S1, S2 , maleimide-functionalized cores with PEG spacers of different length can be easily prepared, and they can all be reacted with the same precursor to rapidly select the most potent inhibitor. Also, although we focused on dimeric peptides, trimeric or higher copy number cores may provide an advantage, especially when the starting HRC inhibitor is weak. Finally, other chemoselective pairs may prove superior in terms of reactivity and yield over the maleimide-cysteine pair. It should be noted however, that the latter pair offers a safety advantage, since it is featured in an antibody-drug conjugate recently approved for human use (ADCETRISH, Seattle Genetics). At this stage, cholesterol-tagging and dimerization represent feasible strategies for boosting the inhibitory potency to levels that, in some cases, may be compatible with in vivo use, without the need for extensive sequence optimization. With the availability of the necessary building blocks, synthesis of cholesterol-tagged monomers and dimers is easily and rapidly accomplished from the same precursor peptide. As such, this strategy may contribute to emergency responses to outbreaks of existing or novel viruses. The activity in vivo of a dimeric cholesterol-tagged inhibitor of NiV supports the potential utility of this strategy. We are currently exploring the scope of this approach on several enveloped viruses. The synthesis of the cholesterol-containing branching core (Table 1) has already been described [38, 43] . Chemoselective conjugation between the Cys-peptide precursors HPIV-P1 and HIV-P1 and the cholesterol derivative 9, to yield conjugates HPIV-P4 and HIV-P4 (Table 1) is detailed in the Figures S1 and S2. Nipah virus (isolate UMMC1; GenBank AY029767) [62] was prepared on Vero-E6 cells as described previously [63] in biosafety level 4 (BSL-4) laboratory Jean Merieux in Lyon, France.  The assays to measure Peptide inhibition of viral entry or viral infectivity were performed as previously described [38, 43, 45] . A brief description of the assays is given below. Antiviral activity against live Nipah virus. In the plaque reduction assay, serial dilutions of peptides in Dulbecco's modified Eagle's medium (DMEM) (Invitrogen) were added to reporter cell monolayers of Vero E6 cells (in 12well-plates, 5.10 5 cells/well) for 1h at 37uC, 5% CO 2 . Then, 200 pfus of NiV were added to the supernatant of the Vero cells and incubated for 1h at 37uC. Supernatants were then replaced by 2ml of 1.6% of Carboxymethylcellulose in DMEM containing 3% of FCS. Plates were incubated for 4 days at 37uC, 5% CO 2 . Plates were finally revealed as a classic central plaque assay, as previously described in Guillaume et al 2004 (REF) . IC 50 were calculated using Graph Pad Prism4 software. Data were expressed as mean6standard deviation (SD). Antiviral activity against HIV-1 in TZM-bl cells. The TZM-bl cell line is an epithelial HeLa-derived cell line engineered to express CD4, CCR5, CXCR4 and integrated reporter genes for firefly luciferase (Luc) and E.coli b-gal under the control of an HIV-1 LTR that is transactivated by the Tat protein synthesized after infection [4] . Cells were seeded into 96-well flat bottomed plastic plates (Falcon, Becton Dickinson Labware, Lincoln Park, NJ) at 1610 4 cells/well and were incubated in the presence or absence of the compounds at 37uC for 1 h in a total volume of 50 ml. Aliquots of CCR5-dependent (R5) HIV-1 Bal or CXCR4dependent (X4) HIV-1 LAI/IIIB viral stocks at the multiplicity of infection (moi) of 4 were then added to a total volume of 100 ml in culture medium containing 15 mg/ml DEAE-dextran (Sigma-Aldrich, St. Louis, MO). Forty-eight h later, the efficiency of virus infection was determined as relative Luc units (RLU) by Luciferase assay system (Promega, Madison, WI). Antiviral activity against HIV-1 in activated peripheral blood mononuclear cells (PBMC). PBMC were isolated from blood obtained at the New York Blood Center, then cultured in RPMI 1640 supplemented with 10% FBS, 10 mM L-glutamine (Cellgro), and 100 U/ml IL-2 (ARRRP, contributed by Hoffman-LaRoche, Inc -Culture Medium). Half the PBMC culture was stimulated with 5 mg/ml of phytohemagglutinin (PHA; Sigma, St. Louis, MO), half with an anti-CD3 mAb (supernatant from the OKT3 hybridoma) in Culture Medium, directly after isolation. After 3 days, the differently stimulated cells were mixed in equal proportions, washed, and suspended in Culture Medium supplemented with 100 mg/ml of penicillin/streptomycin for the remainder of the culture. The PBMC were seeded at 1.4610 6 cells/ml in 100 ml per well in 96-well plates before addition of a serially diluted inhibitor immediately prior to inoculation with the test virus. HIV-1 replication was measured using an in-house p24 Gag antigen ELISA after 7 days of culture. Residual p24 Gag from the input virus in 4 replicates per assay was measured and subtracted. Net p24 Gag production in the test wells was compared with that in the control wells (no inhibitor in 12 replicates/assay, defined as 100%). The inhibitors were titrated in 5-fold steps and each culture well, mixed cells and supernatant, was analyzed. Two assay replicates per condition were combined in the ELISA, e.g. 12 assay 100% viral growth control wells (see above) were combined to 6 ELISA wells. We adapted an assay [64] that detects early stages of fusion activation, since the read-out does not depend upon downstream transactivation events. We used this assay for experiments in which the greater range of detection of this assay was necessary. The assay is based on alpha complementation of beta-gal; the beta-gal protein lacking the N-terminal 85 residues (omega peptide) is expressed from one plasmid, and the N-terminal 85 residues (alpha peptide) is expressed from a second plasmid. Cell fusion leads to complementation, and beta-galactosidase is quantitated using the Galacto-Star (Applied Biosystems) chemiluminescent reporter gene assay system. Receptor bearing cells expressing the omega peptide are mixed with viral glycoproteins co-expressing cells that also express the alpha peptide, at various temperatures and at specific time points. Fusion is stopped by lysing the cells with lysis buffer. Fusion inhibitory peptides are added when the two set of cells are mixed together. Eight-week-old golden hamsters (Mesocricetus auratus, Janvier, France) were anesthetized and infected intraperitoneally (i.p.) with 0.4 mL of NiV in a BSL-4 laboratory. Groups of 5 animals were treated daily by i.p injections of peptide (2 mg/kg) for 10 days, starting from the day of infection, or left untreated. The animals were followed daily for 3 weeks. For comparison of survival curves, Chi 2 analysis was performed using test using Graph Pad Prism4 program. All animals were handled in strict accordance with good animal practice as defined by the French national charter on the ethics of animal experimentation and all efforts were made to minimize suffering. Animal work was approved by the Regional ethical committee (Comité Ethique pour l'Experimentation Animal, CECCAPP, protocol P4_2010_008) and experiments were performed in the INSERM Jean Mérieux BSL-4 laboratory in Lyon, France (French Animal regulation committee Nu B69 387 05 02). \",\n",
              "  'title': 'A General Strategy to Endow Natural Fusion-protein- Derived Peptides with Potent Antiviral Activity'},\n",
              " {'abstract': ['where they acquire an activated pro-survival phenotype with an enhanced respiratory burst thought to contribute to ARDs pathophysiology. our in vitro model enables blood neutrophil transepithelial migration into cell-free tracheal aspirate fluid from patients to recapitulate the primary airway neutrophil phenotype observed in vivo. Neutrophils transmigrated through our model toward airway fluid from children with lower respiratory viral infections coinfected with bacteria had elevated levels of neutrophil activation markers but paradoxically exhibited an inability to kill bacteria and a defective respiratory burst compared with children without bacterial coinfection. The airway fluid from children with bacterial coinfections had higher levels of neutrophil elastase activity, as well as myeloperoxidase levels compared to children without bacterial coinfection. Neutrophils transmigrated into the aspirate fluid from children with bacterial coinfection showed decreased respiratory burst and killing activity against H. influenzae and S. aureus compared to those transmigrated into the aspirate fluid from children without bacterial coinfection. Use of a novel transmigration model recapitulates this pathological phenotype in vitro that would otherwise be impossible in a patient, opening avenues for future mechanistic and therapeutic research.',\n",
              "   'Viral lower airway infections are common in infants and preschool children, and the severity respiratory symptoms can vary from mild cough and congestion to respiratory failure requiring endotracheal intubation and mechanical ventilation. We cannot predict which children will recover quickly versus those who will progress to severe ARDS. No ARDS-specific pharmacological treatments exist, rather treatment is supportive using lung-protective ventilation strategies and the administration of antibiotics for suspected bacterial infection. The study of immune regulation in children is needed because both the lung and immunity are maturing during this critical stage of development and the primary cause of PARDS is direct lung injury due to infection 1,2 .',\n",
              "   'ARDS is characterized by refractory hypoxemia and non-cardiogenic pulmonary edema due to damage to the lung epithelium and pulmonary endothelium. In adults with ARDS increased counts of airway neutrophils are associated with more severe lung injury and mortality 3,4 . Airway neutrophils from adults with ARDS have enhanced survival, a primed respiratory burst response, and increased phagocytic capacity 5 . In patients with pulmonary diseases characterized by chronic bacterial infections, such as cystic fibrosis, airway neutrophils inhibit T-cell function via two pathways -by depletion of arginine following degranulation and activation of Arginase-1 (Arg1), and by activation of the programmed death ligand-1 (PD-L1)/programmed death-1 (PD-1) axis, resulting in reduced proliferation and impaired effector functions 6-15 . By contrast, pulmonary environmental influence on immune cell regulation is poorly characterized in PARDS due to the lack of a model system able to recapitulate the airway neutrophil phenotype in severe paediatric lung injury.',\n",
              "   'Clinical information obtainable at the bedside is often used to prognosticate yet is insufficient for determining the pathobiology of the lung injury. Understanding the biology of neutrophils recruited to the lung during PARDS is crucial for advancing prognostication, risk stratification, and development of novel therapeutic strategies for children who progress to severe PARDS. Herein we hypothesized that markers of degranulation on the surface of airway neutrophils and in the cell-free airway fluid within 24-hours of intubation would be associated with bacterial respiratory co-infection. We used an in vitro model based on blood neutrophil transepithelial migration into the airway fluid of endotracheally intubated children with suspected or confirmed lower airway viral infections at risk for progressing to or with PARDS 16 . We hypothesized that neutrophils recruited to the cell-free airway fluid of children with bacterial coinfections would have a defective respiratory burst and ability to kill bacteria compared to children with no bacterial coinfection.'],\n",
              "  'body_text': [\"Human subjects. This prospective observational study was performed in the paediatric intensive care unit (PICU) at Children's Healthcare of Atlanta at Egleston from January to April 2018. The study was approved by the Institutional Review Board at Emory University, and we confirm that all research was performed in accordance with relevant guidelines and regulations. Informed consent was obtained from the parents of all subjects prior to collection and use of their samples.\",\n",
              "   'All patients greater than 48 hours of age, with a corrected gestational age of at least 40 weeks, who were 18 years old or younger admitted to the PICU, and who met criteria for being at risk or having PARDS as defined by the Pediatric Acute Lung Injury Consensus Conference (PALICC) 2 were screened for eligibility. To be enrolled in the study, children had to have lung injury within 7 days of a known clinical insult, new infiltrate(s) consistent with acute pulmonary parenchymal disease on chest imaging and be receiving oxygen delivered either non-invasively or invasively to maintain an oxygen saturation in the 88-97% range. Respiratory viral infections were confirmed by respiratory viral polymerase chain reaction testing as ordered at the discretion of the primary medical team caring for the patient. Although a viral infection may have been suspected, not all patients had clinical identification of the virus by laboratory testing.',\n",
              "   'Children were excluded if they had any perinatal related lung disease, respiratory failure fully explained by cardiac failure or fluid overload, chronic respiratory failure with mechanical ventilation via a tracheostomy or RAM cannula, confirmed immunodeficiency disorder, immunosuppression from chemotherapy for an oncologic process, chronic immunosuppression in a bone marrow transplant or solid organ transplant recipient, no parent or legal guardian present to provide written informed consent, or the attending physician did not wish the patient to participate in the study.',\n",
              "   'Clinical data collection. Clinical data were abstracted from the medical record onto a standardized form.',\n",
              "   'Variables included demographics; fraction inspired oxygen, mean airway pressure, arterial oxygen saturation or arterial oxygen pressure used to calculate an oxygen saturation index (OSI) or oxygenation index (OI), respectively; laboratory and microbiology results; length of mechanical ventilation and need for reintubation; length of PICU stay, use of high frequency oscillatory ventilation (HFOV) or extracorporeal membrane oxygenation (ECMO); and vital status. Severity of illness was determined by the Pediatric Risk of Mortality (PRISM)-III and Pediatric Logistic Organ Dysfunction (PELOD) scores were calculated within 24 hours of PICU admission [17] [18] [19] [20] . Need for mechanical ventilation to 28-days was monitored to calculate ventilator-free days 21 . Lung injury severity was categorized according to PALICC criteria 2 as follows: At Risk = OI < 4 (OSI < 5); Mild = 4 ≤ OI < 8 (5 ≤ OSI < 7.5); Moderate = 8 ≤ OI < 16 (7.5 ≤ OSI < 12.3); Severe = OI ≥ 16 (OSI ≥ 12.3).',\n",
              "   'Blood and tracheal aspirate sample collections. A 4 mL blood specimen was collected in a K-EDTA vacutainer (Becton Dickinson, Franklin Lakes, NJ) within 24 hours of endotracheal intubation for children weighing greater than 6 kg who had either an arterial or central venous catheter. Serial blood samples were collected every other day for up to one week, and then weekly thereafter, for the duration of mechanical ventilation and/or the presence of either an arterial or central venous catheter. Assays for neutrophil activation were performed within an hour of blood collection and cells were kept at 4 °C until the assay was performed.',\n",
              "   \"Tracheal aspirates were obtained from patients on conventional mechanical ventilation by instilling 1-5 mL of sterile saline through the inline Ballard suction catheter and into a sterile Luken's trap as part of routine suctioning. Serial tracheal aspirate samples were collected every other day for up to one week, and then weekly thereafter, for the duration of mechanical ventilation. There was no weight limit below which a tracheal aspirate could be obtained on a patient. Children who were mechanically ventilated with high frequency oscillation ventilation were suctioned only if clinically indicated and approved by the attending physician. Tracheal aspirate samples were immediately placed on ice for transport to the laboratory for processing.\",\n",
              "   \"Blood and tracheal aspirate sample processing. Blood was spun at 400 × g to separate cells from platelet-rich plasma. Plasma was spun at 3,000 × g to generate platelet-free plasma, aliquoted, and stored at −80 °C. Pelleted blood cells were resuspended in phosphate buffered saline (PBS) with 2.5 mM ethylenediaminetetraacetic acid (EDTA) up to the original whole blood volume for flow cytometry analysis or for neutrophil purification, as described 22 . Neutrophils were purified by negative selection from PBS-EDTA-washed whole blood using the EasySep Direct Human Neutrophil Isolation kit (STEMCELL Technologies Inc., Cambridge, MA) according to the manufacturer's instructions.\",\n",
              "   'Tracheal aspirate was gently dissociated using repeated passage through an 18 G needle after the addition of 6 ml of PBS-EDTA. Dissociated tracheal aspirate was then centrifuged at 800 × g to generate a cell pellet and a fluid fraction. The fluid fraction was spun at 3,000 × g to generate cell-free airway supernatant (ASN), aliquoted, www.nature.com/scientificreports www.nature.com/scientificreports/ and stored at −80 °C. Airway cells were resuspended in PBS-EDTA, counted using a Countess cytometer, and used for flow cytometry assays.',\n",
              "   'Transepithelial migration model for neutrophil conditioning. We used an in vitro model recently developed by our group that recapitulates airway neutrophil phenotype in chosen pathological lung environments. This model was previously applied to cystic fibrosis (CF), asthma, and chronic obstructive pulmonary disease (COPD), using ASN from patients with these conditions added apically to attract and condition naive blood neutrophils through a small airway epithelial lining into the lumen 16 . Briefly, 2 × 10 6 purified blood neutrophils were loaded onto the 200 µm-thick basal compartment of an Alvetex scaffold (ReproCELL, Glasgow, UK) coated with collagen and a monolayer of H441 cells, a human Club cell line, grown for two weeks at an air-liquid interface 16 . Neutrophils were allowed to migrate for 14 hours at 37 °C at 5% CO 2 through the collagen and epithelial layers into the apical compartment comprised of ASN diluted to 33% in RPMI 1640 medium with L-glutamine, or the same medium with the chemoattractant leukotriene B4 (LTB4, 100 nM).',\n",
              "   'Cell staining and flow cytometry. Blood and airway neutrophils collected from patients in vivo and neutrophils transmigrated in the in vitro model were preincubated with human TruStain FcX receptor blocking solution (BioLegend, San Diego, CA) and Live/Dead Aqua (Thermo Fisher Scientific, Waltham, MA) for 10 min on ice in the dark followed by labeling antibodies listed in Table E1 , for 30 min. All panels were applied to blood samples. Due to limited numbers of cells in some tracheal aspirate samples, flow cytometry panels (detailed in Table E1 ) were prioritized as follows: Panel 1, Airway Purity, Fluorescence Minus 5 Control, Panel 2, and Panel 3. Samples were treated with BD Phosflow ™ Lyse/Fix Buffer (BD Biosciences, San Jose, CA), washed twice with PBS-EDTA, and stored at 4 °C in the dark until acquisition on a CytoFLEX flow cytometer (Beckman Coulter, Indianapolis, IN). Transmigrated neutrophils were similarly stained with flow panels described in Table E1 and acquired on an LSRII cytometer (BD Biosciences).',\n",
              "   'Compensation, using AbC Total Antibody and ArC Amine-Reactive Compensation Beads (Thermo Fisher Scientific), gating and analysis were performed with FlowJo v.10 (Tree Star, Ashland, OR). Single cells were separated from doublet cells by gating on forward scatter area versus forward scatter height. Neutrophils were selected based on their forward scatter area versus side scatter area profiles. Live cells were then selected by exclusion of dead events positive for the dye Live/Dead Aqua, and platelets or platelet/leukocyte aggregates were excluded by staining for CD41a + events. CD66b + neutrophils were then confirmed by gating on CD66b versus side scatter area for both tracheal aspirate (Fig. E1A ) and whole blood neutrophils (Fig. E1B ). Mean fluorescence intensities of surface markers are reported for CD66b + neutrophils. To determine the background mean fluorescence intensity signal in the five reporter channels (PB450, AF488, PECy7, PE, and APC) we report mean fluorescence signal intensity in CD66b + neutrophils from the blood and airway samples that were only stained for CD41a, Live/ Dead aqua, CD66b, and CD16 (fluorescence minus (FM) five) controls (Fig. E2 ).',\n",
              "   \"Human neutrophil elastase (HNE) activity was measured in ASN and plasma according to the supplier's protocol (Cayman Chemical, Ann Arbor, MI), with a kit-supplied standard curve. In addition, human matrix metalloproteinase-9 (MMP-9) DuoSet, myeloperoxidase (MPO) Quantikine ELISA kits (R&D Systems, Minneapolis, MN), and human lactoferrin ELISA kit (Abcam, Cambridge, MA) were used according to suppliers' protocols, and protein concentrations calculated using supplied standard curves. Data were collected on a BioTek (Winooski, VT) Synergy HT 96-well plate reader with recommended wavelengths and standard curve fit procedures.\",\n",
              "   'Neutrophil respiratory burst assay. Neutrophil respiratory burst intensity was assessed with dihydrorhodamine 123 after stimulation with 100 ng/mL of N-formyl-methionyl-leucyl-phenylalanine (fMLF) as described using a FACSCalibur cytometer 23, 24 . Phorbol 12-myristate 13-acetate (PMA) was used at a final concentration of 200 nM as a positive control for activation.',\n",
              "   'Bacterial killing assay. S. aureus and H. influenzae were grown in Luria broth (LB) or Chocolate media, respectively, at 37 °C with aeration to an optical density (600 nm) of 0.5. Bacteria were pelleted by centrifugation at 14,000 × g for 1 min at room temperature, resuspended in 500 µL 10% human serum in RPMI and opsonized for 30 min at 37 °C. Opsonized bacteria were added to neutrophils at a multiplicity of infection of 1. After 1 h of incubation at 37 °C, the cultures were lysed using 0.1% Triton for 2 min, after which the bacteria were serially diluted and plated in triplicate on LB or Chocolate agar plates, respectively, overnight at 37 °C in a non-CO 2 incubator. Viable bacterial colony forming unit (CFUs) were counted the following day and reported as a percentage of bacterial counts recorded from bacteria incubated in absence of neutrophils. Data analysis. Statistics were performed using JMP Pro 13 (SAS Institute, Cary, NC) and Prism 7 (GraphPad, San Diego, CA) for Windows. Unless otherwise stated, comparisons between samples were made using a Mann-Whitney U test or ANOVA with post-hoc Tukey test for multiple comparisons. Statistical significance was defined as a p value less than 0.05.',\n",
              "   \"Nineteen patients in 20 admission encounters met criteria for being at risk for having PARDS, and in all 20 patient encounters the patient's parent consented to study participation. One patient (number 6) was excluded as the primary team caring for this patient believed that his multiple congenital anomalies contributed to his decompensation and intubation during an imaging study rather than an infection; however, six weeks later this patient www.nature.com/scientificreports www.nature.com/scientificreports/ (number 14) was readmitted and the parents again consented to the study. Table 1 Change in phenotype of neutrophils after airway migration from the circulation. Using flow cytometry, we compared the expression of critical surface markers between blood and airway neutrophils in children with acute lower airway infections within 24 hours of endotracheal intubation. Representative flow cytometry histograms showing the heterogeneity of surface marker expression in airway and blood neutrophils are shown in Fig. 1A -D. Both L-selectin (CD62L) and CD16, the low affinity Fc gamma receptor for immunoglobulin G (IgG), which can mediate degranulation, phagocytosis, and oxidative burst, were shed upon airway migration. Cell surface expression of CD63, a marker of primary granule exocytosis, and CD66b, a marker of secondary granule exocytosis, were increased in the airway compared with blood neutrophils. Granule release by airway neutrophils was confirmed by the presence of significant activity of human neutrophil elastase (HNE), a protease contained within primary granules, and matrix metalloprotein 9 (MMP-9) protein levels, a protease contained within secretory granules, in the cell-free airway fluid compared with platelet-free plasma (Fig. 1E,F) .\",\n",
              "   'We further characterized differences in surface expression of integrins responsible for adhesion and activation of the neutrophil respiratory burst, complement/antigen presentation, and IL8 chemotaxis receptors in airway vs. blood neutrophils (Fig. 2) . CD11b (integrin alpha M) and CD11c (integrin alpha X) were increased, while CD49d (VLA-4α) and CD54 (ICAM-1) were decreased on airway compared to blood neutrophils. The antigen presenting receptor HLA-DR (major histocompatibility class II) was also increased in airway compared with blood neutrophils. CD35 (complement receptor 1) was decreased in airway compared to blood neutrophils, while CD88 (complement receptor 5) and CD32 (medium affinity IgG receptor, which mediates phagocytosis, oxidative burst, platelet aggregation and immunomodulation) were unchanged. Finally, both CD181 (CXCR1 or IL8RA) and CD182 (CXCR2 or IL8RB) receptors were decreased in the airway neutrophils compared to blood neutrophils.',\n",
              "   'Human neutrophil elastase activity is increased in the airway fluid of children with bacterial respiratory co-infections. Neutrophil degranulation is associated with increased severity of lung disease due to infection. HNE activity increased with versus without airway bacterial coinfection (Fig. 3) . In addition to activity of HNE (Fig. 3A) , MPO levels, but neither lactoferrin nor MMP-9, were higher in ASN from children with bacterial coinfection in the airways than those without (Fig. 3B-D) .',\n",
              "   'In vitro modeling of airway neutrophil conditioning in PARDS patients. In order to further characterize differences in neutrophils recruited to the airways of children with or without bacterial coinfections www.nature.com/scientificreports www.nature.com/scientificreports/ following lower airway viral infections, we used ASN from children with lower airway viral infection collected within 24 hours of endotracheal intubation to show that this pathological milieu induces transepithelial migration of blood neutrophils in this in vitro model. Similar modulation of CD66b, CD63, CD16, and CD181 were observed between primary airway neutrophils from patients and donor neutrophils transmigrated into patient ASN compared to blood neutrophils (pre-transmigration) (Fig. 4A-D) . Although patient ASN had intrinsic HNE activity, there was no evidence for surface recapture of HNE in transmigrated neutrophils (Fig. 4E) . Unlike the in vivo patient data, CD88 (complement receptor 5a) was decreased in neutrophils transmigrated to ASN (Fig. 4F) , and HLA-DR was not different in neutrophils transmigrated to ASN (Fig. 4G) compared with blood neutrophils. In vivo, CXCR4 is a surface marker expressed on human neutrophils that plays a role in tissue retention [25] [26] [27] . www.nature.com/scientificreports www.nature.com/scientificreports/ Upon neutrophil transmigration in vitro, CXCR4 was upregulated compared to blood neutrophils (Fig. 4H) . Exploration of the Arg1 and PD-L1 axis demonstrated that Arg1 expression was increased on the cell surface of neutrophils transmigrated to ASN (Fig. 4I) . Neutrophils transmigrated into pooled Day 1 ASN from all patients had decreased PD-L1 surface expression compared to blood neutrophils (Fig. 4J) . However, we did not detect significant differences in Arg1 and PD-L1 expression on blood and airway neutrophils in vivo (data not shown). Experimental controls using negatively selected neutrophils rather than whole blood neutrophils (Fig. E3) and direct incubation of neutrophils with ASN compared with transmigration (Fig. E4 ) did not show significantly ',\n",
              "   'We next compared the respiratory burst capacity of blood neutrophils (Fig. 5A) to that of neutrophils transmigrated toward LTB4 (chemoattractant control) or patient ASN (Fig. 5B) . For blood neutrophils, there was no response at rest or upon fMLF stimulus without initial priming with granulocyte macrophage-colony stimulating factor (GM-CSF), and the burst intensity upon GM-CSF + fMLF treatment was much lower than that seen with the PMA positive control (Fig. 5A ). In contrast, neutrophils transmigrated toward LTB4 or pooled Day 1 ASN from all patients showed an increased respiratory burst intensity to fMLF compared to unstimulated transmigrated neutrophils (Fig. 5B) . Coincubation of neutrophils with pooled Day 1 ASN, without transmigration, for the same duration in serum-free media resulted in stimulation of the respiratory burst with no increase in intensity with addition of fMLF. Neutrophils transmigrated toward ASN was bimodal with a diminished fMLF-stimulated respiratory burst compared with neutrophils transmigrated toward LTB4. Transmigration through the small airway epithelial model primes neutrophils for an increased respiratory burst to fMLF stimulation, similar in intensity to PMA stimulus, compared with blood neutrophils stimulated with GM-CSF (compare Fig. 5A,B) .',\n",
              "   'Next, we compared neutrophils transmigrated to patient ASN with bacterial coinfection (corresponding to high HNE activity) to those transmigrated to patient ASN with no bacterial coinfection (corresponding to low HNE activity). As shown in Fig. 5C ,D, neutrophils transmigrated to ASN from patients with bacterial coinfection had a lower fMLF-stimulated respiratory burst compared to those transmigrated to ASN from patients without bacterial coinfection. Neutrophils transmigrated to ASN from patients without bacterial coinfection had a lower respiratory burst than those transmigrated to LTB4. All conditions led to similar respiratory burst in response to PMA (solid histograms in Fig. 5D ).',\n",
              "   'As seen in the healthy donor blood neutrophils, circulating neutrophils from patients also had low levels of priming as shown by a low respiratory burst with fMLF stimulation compared with PMA. The range of respiratory burst intensity at rest and after fMLF and PMA stimulation is illustrated in Fig. E5A -D, with some patients demonstrating blood neutrophils that are primed to respond to fMLF and some that are not (Fig. E5C,D) .',\n",
              "   'Surface expression of CD16 and CD62L were measured on neutrophils from patient blood obtained within 24 hours of intubation, at rest and following stimulation with fMLF or PMA. Neutrophils that shed CD62L and have high CD16 expression have been previously associated with an immunosuppressive phenotype, while neutrophils with low levels of both CD62L and CD16 are considered immature 14,28-30 . We did not observe elevated percentages of either of these immunosuppressive or immature neutrophil populations in our patients on Days ',\n",
              "   'AsN. We compared surface protein expression of markers in neutrophils transmigrated to HNE-rich and HNE-poor ASN. As shown in Fig. 6A-D, Arg1 , CD63, CD66b were increased and CD16 expression was decreased in neutrophils transmigrated to bacterial coinfected patient ASN versus no bacterial coinfection patient ASN www.nature.com/scientificreports www.nature.com/scientificreports/ ( Fig. 6A-D) . The complete set of surface markers assessed in those two conditions, in comparison with blood neutrophils (pre-transmigration) and with neutrophils transmigrated to LTB4 is shown in Fig. E6 .',\n",
              "   'Finally, we performed bacterial killing assays by neutrophils of H. influenzae and S. aureus, which are PARDS-associated gram-negative and gram-positive bacteria, respectively. Neutrophils transmigrated toward bacterial coinfected ASN showed a lower ability to kill both H. influenzae and S. aureus than those transmigrated to no bacterial coinfection ASN (Fig. 7) . Neutrophils transmigrated toward LTB4 killed H. influenzae with similar efficiency as those transmigrated to HNE-poor ASN, while for S. aureus they were less efficient (Fig. 7) .',\n",
              "   'Blood neutrophils recruited to the lungs of children at risk of or with PARDS due to lower airway viral infections are generally believed to rapidly die therein, leading to the passive release of HNE and other toxic by-products that promote lung injury [31] [32] [33] . In contrast with this conventional paradigm, the findings presented here support the notion that a large population of neutrophils remains viable and undergo profound changes upon recruitment to the airways of these patients. Viable airway neutrophils demonstrated surface mobilization of multiple sets of granules, and lose surface expression of CD16, a key phagocytic receptor. Furthermore, airway neutrophils increased expression of HLA-DR, typically associated with professional antigen-presenting cells, thus reflecting functional changes. To further investigate this process, we adapted an airway inflammation model developed in our group to study diseases of chronic lung inflammation (CF, asthma, COPD) to acute lung inflammatory processes occurring in children with acute respiratory failure due to lower airway infections. This model allowed www.nature.com/scientificreports www.nature.com/scientificreports/ for transepithelial recruitment and pathological conditioning of neutrophils by cell-free patient airway fluid and recapitulated cardinal features of airway neutrophils collected from these patients in vivo. In addition, we identified an association between active HNE exocytosis and bacterial coinfections within 24 hours of endotracheal intubation in these patients and observed that neutrophils recruited to the cell-free airway fluid of patients coinfected with bacteria become deficient in their respiratory burst capacity and in their ability to kill bacteria.',\n",
              "   'HNE is a serine protease contained in primary granules, and elevated levels in bronchoalveolar lavage and plasma are associated with severity of lung injury in ARDS 34 . While extracellular HNE can reflect live neutrophil activation and degranulation, in the tracheal aspirate both necrotic and neutrophils releasing neutrophil extracellular traps (NETs) may also contribute to increased extracellular levels of HNE, thus precluding the use of extracellular HNE activity as a stringent marker of live neutrophil degranulation. Elevated levels of MMP-9 in the lung epithelial lining fluid of patients with ARDS has also been associated with increased severity of lung injury 34, 35 . Primary granule exocytosis in airway compared to blood neutrophils is evidenced by the increase in CD63 expression in addition to decreases in CD16 and CD35 expression as the latter proteins contain HNE and MMP cleavage sites and may also be removed by membrane reuptake 9, 36 . While CD62L downregulation is expected, CD16 expression is generally increased upon transmigration due to degranulation of secretory vesicles www.nature.com/scientificreports www.nature.com/scientificreports/ and tertiary granules 37, 38 ; however, CD16 can be downregulated if endocytosed and cleaved by high activity levels of HNE and MMP-9 16, 36 . Secondary granule exocytosis in airway neutrophils is evidenced by an increase in CD66b expression compared to blood neutrophils. Whether this abnormal activation response can be leveraged therapeutically remains unclear. Indeed, HNE inhibitors, such as sivelestat, have failed to improve mortality in ARDS patients likely due to competing proteases, release of other damage-associated molecular pattern molecules and alarmins, and the immunomodulatory effects of neutrophils on T-cells in the airways of ARDS patients 39 . Significant differences in neutrophil activation markers between the blood and airway compartments observed in our patient population is consistent with prior studies 5, 9, 16, 22, 40 . Our results highlight the importance of studying the airway fluid and cells recruited therein, rather than simply inferring airway neutrophil behavior and function based on cells isolated from blood.',\n",
              "   'Neutrophil priming by agents such as GM-CSF, tumor necrosis factor α or lipopolysaccharide delay apoptosis of neutrophils at sites of inflammation and increase their degranulation and respiratory burst responses to an activating agent 5, 41 . Interestingly, one of the roles assigned to the healthy pulmonary vasculature is to selectively retain primed neutrophils, deprime and release them into the bloodstream 42 . This depriming mechanism may be dysfunctional in ARDS, resulting in release of primed neutrophils into the systemic vasculature that can damage extra-pulmonary organs 42 . Migration of healthy donor neutrophils through our small airway epithelial model primes these neutrophils to undergo a respiratory burst; however, migration to ASN with high NE activity had an attenuated respiratory burst upon fMLF stimulation. The decreased respiratory burst in the presence of HNE-rich ASN from bacterially coinfected patients may serve as rapidly assessed biomarker of bacterial coinfection. The mechanism to explain the poor killing of H. influenzae and S. aureus by neutrophils transmigrated to HNE-rich ASN in our model, which is associated with the clinical outcome of a bacterial coinfection, remains to be explored. An increase in relative Arg1 gene transcript levels has been shown in blood neutrophils from ARDS patients relative to healthy volunteers 5 consistent with our finding of an upregulation in Arg1 surface expression in neutrophils transmigrated to bacterial coinfected ASN. The influence of other immunoregulatory pathways, such as the PD-L1/PD-1 axis, are under investigation as a possible mechanism to explain bacterial coinfection in some children for viral induced respiratory failure.',\n",
              "   'While our transepithelial neutrophil migration model sets up the possibility for controlled studies of the fate of neutrophils in PARDS patients, we acknowledge several limitations. First, we did not perform full functional analyses on primary airway neutrophils due to limited cellular material from patients. Instead, we used cell surface markers of activation as a proxy to inform how well our transepithelial migration model compared to the changes seen in blood and airway neutrophils from patients. In addition, most of our experimental data comes from the transepithelial migration model which recapitulates the small airways -respiratory generation 8 to 16. The tracheal aspirates from the patients were actually collected from airway generation 1 to 2; however, bronchoalveolar lavage of children is not commonly performed unless needed for diagnostic and therapeutic purposes for severe lung injury. Second, we are limited in our ability to collect blood samples from children with a weight under 6 kg or without a central venous or arterial catheter for blood sampling, which made paired comparisons between blood and airway neutrophils from each patient impossible. Nevertheless, despite our limited numbers of patients, we sampled enough patients to identify significant differences in activation and immunomodulatory markers on neutrophils. Although we previously showed differential neutrophil behavior comparing hypertonic saline-induced sputum cells from CF patients and healthy adults 9,16,22 , we were not able to include controls in this study owing to ethical limitations on obtaining non-clinically indicated airway lavage samples on children intubated for elective surgeries. In addition, children intubated for airway protection, rather than for respiratory failure due to a pulmonary cause, do not have neutrophil-rich airway lavage samples making a direct comparison of cellular material impossible to perform. Instead, we focused on serial blood and airway compartment sampling over time in the PICU to profile how neutrophils change such that each patient may act as their own control in future studies. While children in this study ranged in age from 9 days to 16 years, the majority were under 2 years of age limiting comparisons of neutrophil behavior stratified by age. Finally, patients included in this study were infected with a variety of respiratory viruses and due to limited sample size, we cannot determine the effect of any one virus on airway neutrophil behavior or susceptibility to bacterial coinfection. Despite the infectious heterogeneity of our limited number of samples, we were able to detect a significant neutrophil dysfunction signal in the presence of an activated neutrophil environment.',\n",
              "   'In summary, our study highlights phenotypic differences between airway and blood neutrophils in patients at risk of or with PARDS due to lower respiratory tract viral infections with or without bacterial coinfection, emphasizing the need to study compartment-specific behaviors of neutrophils. In addition, we showed that bacterial coinfections on Day 1 of illness may be predicted using markers of neutrophil granule release, immunomodulatory proteins, and metabolic activities, which may inform antimicrobial treatment of patients. Finally, we showcased a novel in vitro transmigration model to study airway neutrophil function following recruitment to and conditioning by patient cell-free airway fluid, laying critical foundations for future mechanistic and therapeutic studies of airway neutrophils in PARDS.',\n",
              "   'The datasets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request.'],\n",
              "  'paper_id': 'a92d2df5aae260091456d3a65800c01cca79d599',\n",
              "  'path': 'comm_use_subset/comm_use_subset/pdf_json/',\n",
              "  'text': \" Neutrophil Dysfunction in the Airways of Children with Acute Respiratory Failure Due to Lower Respiratory tract Viral and Bacterial Coinfections where they acquire an activated pro-survival phenotype with an enhanced respiratory burst thought to contribute to ARDs pathophysiology. our in vitro model enables blood neutrophil transepithelial migration into cell-free tracheal aspirate fluid from patients to recapitulate the primary airway neutrophil phenotype observed in vivo. Neutrophils transmigrated through our model toward airway fluid from children with lower respiratory viral infections coinfected with bacteria had elevated levels of neutrophil activation markers but paradoxically exhibited an inability to kill bacteria and a defective respiratory burst compared with children without bacterial coinfection. The airway fluid from children with bacterial coinfections had higher levels of neutrophil elastase activity, as well as myeloperoxidase levels compared to children without bacterial coinfection. Neutrophils transmigrated into the aspirate fluid from children with bacterial coinfection showed decreased respiratory burst and killing activity against H. influenzae and S. aureus compared to those transmigrated into the aspirate fluid from children without bacterial coinfection. Use of a novel transmigration model recapitulates this pathological phenotype in vitro that would otherwise be impossible in a patient, opening avenues for future mechanistic and therapeutic research. Viral lower airway infections are common in infants and preschool children, and the severity respiratory symptoms can vary from mild cough and congestion to respiratory failure requiring endotracheal intubation and mechanical ventilation. We cannot predict which children will recover quickly versus those who will progress to severe ARDS. No ARDS-specific pharmacological treatments exist, rather treatment is supportive using lung-protective ventilation strategies and the administration of antibiotics for suspected bacterial infection. The study of immune regulation in children is needed because both the lung and immunity are maturing during this critical stage of development and the primary cause of PARDS is direct lung injury due to infection 1,2 . ARDS is characterized by refractory hypoxemia and non-cardiogenic pulmonary edema due to damage to the lung epithelium and pulmonary endothelium. In adults with ARDS increased counts of airway neutrophils are associated with more severe lung injury and mortality 3,4 . Airway neutrophils from adults with ARDS have enhanced survival, a primed respiratory burst response, and increased phagocytic capacity 5 . In patients with pulmonary diseases characterized by chronic bacterial infections, such as cystic fibrosis, airway neutrophils inhibit T-cell function via two pathways -by depletion of arginine following degranulation and activation of Arginase-1 (Arg1), and by activation of the programmed death ligand-1 (PD-L1)/programmed death-1 (PD-1) axis, resulting in reduced proliferation and impaired effector functions 6-15 . By contrast, pulmonary environmental influence on immune cell regulation is poorly characterized in PARDS due to the lack of a model system able to recapitulate the airway neutrophil phenotype in severe paediatric lung injury. Clinical information obtainable at the bedside is often used to prognosticate yet is insufficient for determining the pathobiology of the lung injury. Understanding the biology of neutrophils recruited to the lung during PARDS is crucial for advancing prognostication, risk stratification, and development of novel therapeutic strategies for children who progress to severe PARDS. Herein we hypothesized that markers of degranulation on the surface of airway neutrophils and in the cell-free airway fluid within 24-hours of intubation would be associated with bacterial respiratory co-infection. We used an in vitro model based on blood neutrophil transepithelial migration into the airway fluid of endotracheally intubated children with suspected or confirmed lower airway viral infections at risk for progressing to or with PARDS 16 . We hypothesized that neutrophils recruited to the cell-free airway fluid of children with bacterial coinfections would have a defective respiratory burst and ability to kill bacteria compared to children with no bacterial coinfection. Human subjects. This prospective observational study was performed in the paediatric intensive care unit (PICU) at Children's Healthcare of Atlanta at Egleston from January to April 2018. The study was approved by the Institutional Review Board at Emory University, and we confirm that all research was performed in accordance with relevant guidelines and regulations. Informed consent was obtained from the parents of all subjects prior to collection and use of their samples. All patients greater than 48 hours of age, with a corrected gestational age of at least 40 weeks, who were 18 years old or younger admitted to the PICU, and who met criteria for being at risk or having PARDS as defined by the Pediatric Acute Lung Injury Consensus Conference (PALICC) 2 were screened for eligibility. To be enrolled in the study, children had to have lung injury within 7 days of a known clinical insult, new infiltrate(s) consistent with acute pulmonary parenchymal disease on chest imaging and be receiving oxygen delivered either non-invasively or invasively to maintain an oxygen saturation in the 88-97% range. Respiratory viral infections were confirmed by respiratory viral polymerase chain reaction testing as ordered at the discretion of the primary medical team caring for the patient. Although a viral infection may have been suspected, not all patients had clinical identification of the virus by laboratory testing. Children were excluded if they had any perinatal related lung disease, respiratory failure fully explained by cardiac failure or fluid overload, chronic respiratory failure with mechanical ventilation via a tracheostomy or RAM cannula, confirmed immunodeficiency disorder, immunosuppression from chemotherapy for an oncologic process, chronic immunosuppression in a bone marrow transplant or solid organ transplant recipient, no parent or legal guardian present to provide written informed consent, or the attending physician did not wish the patient to participate in the study. Clinical data collection. Clinical data were abstracted from the medical record onto a standardized form. Variables included demographics; fraction inspired oxygen, mean airway pressure, arterial oxygen saturation or arterial oxygen pressure used to calculate an oxygen saturation index (OSI) or oxygenation index (OI), respectively; laboratory and microbiology results; length of mechanical ventilation and need for reintubation; length of PICU stay, use of high frequency oscillatory ventilation (HFOV) or extracorporeal membrane oxygenation (ECMO); and vital status. Severity of illness was determined by the Pediatric Risk of Mortality (PRISM)-III and Pediatric Logistic Organ Dysfunction (PELOD) scores were calculated within 24 hours of PICU admission [17] [18] [19] [20] . Need for mechanical ventilation to 28-days was monitored to calculate ventilator-free days 21 . Lung injury severity was categorized according to PALICC criteria 2 as follows: At Risk = OI < 4 (OSI < 5); Mild = 4 ≤ OI < 8 (5 ≤ OSI < 7.5); Moderate = 8 ≤ OI < 16 (7.5 ≤ OSI < 12.3); Severe = OI ≥ 16 (OSI ≥ 12.3). Blood and tracheal aspirate sample collections. A 4 mL blood specimen was collected in a K-EDTA vacutainer (Becton Dickinson, Franklin Lakes, NJ) within 24 hours of endotracheal intubation for children weighing greater than 6 kg who had either an arterial or central venous catheter. Serial blood samples were collected every other day for up to one week, and then weekly thereafter, for the duration of mechanical ventilation and/or the presence of either an arterial or central venous catheter. Assays for neutrophil activation were performed within an hour of blood collection and cells were kept at 4 °C until the assay was performed. Tracheal aspirates were obtained from patients on conventional mechanical ventilation by instilling 1-5 mL of sterile saline through the inline Ballard suction catheter and into a sterile Luken's trap as part of routine suctioning. Serial tracheal aspirate samples were collected every other day for up to one week, and then weekly thereafter, for the duration of mechanical ventilation. There was no weight limit below which a tracheal aspirate could be obtained on a patient. Children who were mechanically ventilated with high frequency oscillation ventilation were suctioned only if clinically indicated and approved by the attending physician. Tracheal aspirate samples were immediately placed on ice for transport to the laboratory for processing. Blood and tracheal aspirate sample processing. Blood was spun at 400 × g to separate cells from platelet-rich plasma. Plasma was spun at 3,000 × g to generate platelet-free plasma, aliquoted, and stored at −80 °C. Pelleted blood cells were resuspended in phosphate buffered saline (PBS) with 2.5 mM ethylenediaminetetraacetic acid (EDTA) up to the original whole blood volume for flow cytometry analysis or for neutrophil purification, as described 22 . Neutrophils were purified by negative selection from PBS-EDTA-washed whole blood using the EasySep Direct Human Neutrophil Isolation kit (STEMCELL Technologies Inc., Cambridge, MA) according to the manufacturer's instructions. Tracheal aspirate was gently dissociated using repeated passage through an 18 G needle after the addition of 6 ml of PBS-EDTA. Dissociated tracheal aspirate was then centrifuged at 800 × g to generate a cell pellet and a fluid fraction. The fluid fraction was spun at 3,000 × g to generate cell-free airway supernatant (ASN), aliquoted, www.nature.com/scientificreports www.nature.com/scientificreports/ and stored at −80 °C. Airway cells were resuspended in PBS-EDTA, counted using a Countess cytometer, and used for flow cytometry assays. Transepithelial migration model for neutrophil conditioning. We used an in vitro model recently developed by our group that recapitulates airway neutrophil phenotype in chosen pathological lung environments. This model was previously applied to cystic fibrosis (CF), asthma, and chronic obstructive pulmonary disease (COPD), using ASN from patients with these conditions added apically to attract and condition naive blood neutrophils through a small airway epithelial lining into the lumen 16 . Briefly, 2 × 10 6 purified blood neutrophils were loaded onto the 200 µm-thick basal compartment of an Alvetex scaffold (ReproCELL, Glasgow, UK) coated with collagen and a monolayer of H441 cells, a human Club cell line, grown for two weeks at an air-liquid interface 16 . Neutrophils were allowed to migrate for 14 hours at 37 °C at 5% CO 2 through the collagen and epithelial layers into the apical compartment comprised of ASN diluted to 33% in RPMI 1640 medium with L-glutamine, or the same medium with the chemoattractant leukotriene B4 (LTB4, 100 nM). Cell staining and flow cytometry. Blood and airway neutrophils collected from patients in vivo and neutrophils transmigrated in the in vitro model were preincubated with human TruStain FcX receptor blocking solution (BioLegend, San Diego, CA) and Live/Dead Aqua (Thermo Fisher Scientific, Waltham, MA) for 10 min on ice in the dark followed by labeling antibodies listed in Table E1 , for 30 min. All panels were applied to blood samples. Due to limited numbers of cells in some tracheal aspirate samples, flow cytometry panels (detailed in Table E1 ) were prioritized as follows: Panel 1, Airway Purity, Fluorescence Minus 5 Control, Panel 2, and Panel 3. Samples were treated with BD Phosflow ™ Lyse/Fix Buffer (BD Biosciences, San Jose, CA), washed twice with PBS-EDTA, and stored at 4 °C in the dark until acquisition on a CytoFLEX flow cytometer (Beckman Coulter, Indianapolis, IN). Transmigrated neutrophils were similarly stained with flow panels described in Table E1 and acquired on an LSRII cytometer (BD Biosciences). Compensation, using AbC Total Antibody and ArC Amine-Reactive Compensation Beads (Thermo Fisher Scientific), gating and analysis were performed with FlowJo v.10 (Tree Star, Ashland, OR). Single cells were separated from doublet cells by gating on forward scatter area versus forward scatter height. Neutrophils were selected based on their forward scatter area versus side scatter area profiles. Live cells were then selected by exclusion of dead events positive for the dye Live/Dead Aqua, and platelets or platelet/leukocyte aggregates were excluded by staining for CD41a + events. CD66b + neutrophils were then confirmed by gating on CD66b versus side scatter area for both tracheal aspirate (Fig. E1A ) and whole blood neutrophils (Fig. E1B ). Mean fluorescence intensities of surface markers are reported for CD66b + neutrophils. To determine the background mean fluorescence intensity signal in the five reporter channels (PB450, AF488, PECy7, PE, and APC) we report mean fluorescence signal intensity in CD66b + neutrophils from the blood and airway samples that were only stained for CD41a, Live/ Dead aqua, CD66b, and CD16 (fluorescence minus (FM) five) controls (Fig. E2 ). Human neutrophil elastase (HNE) activity was measured in ASN and plasma according to the supplier's protocol (Cayman Chemical, Ann Arbor, MI), with a kit-supplied standard curve. In addition, human matrix metalloproteinase-9 (MMP-9) DuoSet, myeloperoxidase (MPO) Quantikine ELISA kits (R&D Systems, Minneapolis, MN), and human lactoferrin ELISA kit (Abcam, Cambridge, MA) were used according to suppliers' protocols, and protein concentrations calculated using supplied standard curves. Data were collected on a BioTek (Winooski, VT) Synergy HT 96-well plate reader with recommended wavelengths and standard curve fit procedures. Neutrophil respiratory burst assay. Neutrophil respiratory burst intensity was assessed with dihydrorhodamine 123 after stimulation with 100 ng/mL of N-formyl-methionyl-leucyl-phenylalanine (fMLF) as described using a FACSCalibur cytometer 23, 24 . Phorbol 12-myristate 13-acetate (PMA) was used at a final concentration of 200 nM as a positive control for activation. Bacterial killing assay. S. aureus and H. influenzae were grown in Luria broth (LB) or Chocolate media, respectively, at 37 °C with aeration to an optical density (600 nm) of 0.5. Bacteria were pelleted by centrifugation at 14,000 × g for 1 min at room temperature, resuspended in 500 µL 10% human serum in RPMI and opsonized for 30 min at 37 °C. Opsonized bacteria were added to neutrophils at a multiplicity of infection of 1. After 1 h of incubation at 37 °C, the cultures were lysed using 0.1% Triton for 2 min, after which the bacteria were serially diluted and plated in triplicate on LB or Chocolate agar plates, respectively, overnight at 37 °C in a non-CO 2 incubator. Viable bacterial colony forming unit (CFUs) were counted the following day and reported as a percentage of bacterial counts recorded from bacteria incubated in absence of neutrophils. Data analysis. Statistics were performed using JMP Pro 13 (SAS Institute, Cary, NC) and Prism 7 (GraphPad, San Diego, CA) for Windows. Unless otherwise stated, comparisons between samples were made using a Mann-Whitney U test or ANOVA with post-hoc Tukey test for multiple comparisons. Statistical significance was defined as a p value less than 0.05. Nineteen patients in 20 admission encounters met criteria for being at risk for having PARDS, and in all 20 patient encounters the patient's parent consented to study participation. One patient (number 6) was excluded as the primary team caring for this patient believed that his multiple congenital anomalies contributed to his decompensation and intubation during an imaging study rather than an infection; however, six weeks later this patient www.nature.com/scientificreports www.nature.com/scientificreports/ (number 14) was readmitted and the parents again consented to the study. Table 1 Change in phenotype of neutrophils after airway migration from the circulation. Using flow cytometry, we compared the expression of critical surface markers between blood and airway neutrophils in children with acute lower airway infections within 24 hours of endotracheal intubation. Representative flow cytometry histograms showing the heterogeneity of surface marker expression in airway and blood neutrophils are shown in Fig. 1A -D. Both L-selectin (CD62L) and CD16, the low affinity Fc gamma receptor for immunoglobulin G (IgG), which can mediate degranulation, phagocytosis, and oxidative burst, were shed upon airway migration. Cell surface expression of CD63, a marker of primary granule exocytosis, and CD66b, a marker of secondary granule exocytosis, were increased in the airway compared with blood neutrophils. Granule release by airway neutrophils was confirmed by the presence of significant activity of human neutrophil elastase (HNE), a protease contained within primary granules, and matrix metalloprotein 9 (MMP-9) protein levels, a protease contained within secretory granules, in the cell-free airway fluid compared with platelet-free plasma (Fig. 1E,F) . We further characterized differences in surface expression of integrins responsible for adhesion and activation of the neutrophil respiratory burst, complement/antigen presentation, and IL8 chemotaxis receptors in airway vs. blood neutrophils (Fig. 2) . CD11b (integrin alpha M) and CD11c (integrin alpha X) were increased, while CD49d (VLA-4α) and CD54 (ICAM-1) were decreased on airway compared to blood neutrophils. The antigen presenting receptor HLA-DR (major histocompatibility class II) was also increased in airway compared with blood neutrophils. CD35 (complement receptor 1) was decreased in airway compared to blood neutrophils, while CD88 (complement receptor 5) and CD32 (medium affinity IgG receptor, which mediates phagocytosis, oxidative burst, platelet aggregation and immunomodulation) were unchanged. Finally, both CD181 (CXCR1 or IL8RA) and CD182 (CXCR2 or IL8RB) receptors were decreased in the airway neutrophils compared to blood neutrophils. Human neutrophil elastase activity is increased in the airway fluid of children with bacterial respiratory co-infections. Neutrophil degranulation is associated with increased severity of lung disease due to infection. HNE activity increased with versus without airway bacterial coinfection (Fig. 3) . In addition to activity of HNE (Fig. 3A) , MPO levels, but neither lactoferrin nor MMP-9, were higher in ASN from children with bacterial coinfection in the airways than those without (Fig. 3B-D) . In vitro modeling of airway neutrophil conditioning in PARDS patients. In order to further characterize differences in neutrophils recruited to the airways of children with or without bacterial coinfections www.nature.com/scientificreports www.nature.com/scientificreports/ following lower airway viral infections, we used ASN from children with lower airway viral infection collected within 24 hours of endotracheal intubation to show that this pathological milieu induces transepithelial migration of blood neutrophils in this in vitro model. Similar modulation of CD66b, CD63, CD16, and CD181 were observed between primary airway neutrophils from patients and donor neutrophils transmigrated into patient ASN compared to blood neutrophils (pre-transmigration) (Fig. 4A-D) . Although patient ASN had intrinsic HNE activity, there was no evidence for surface recapture of HNE in transmigrated neutrophils (Fig. 4E) . Unlike the in vivo patient data, CD88 (complement receptor 5a) was decreased in neutrophils transmigrated to ASN (Fig. 4F) , and HLA-DR was not different in neutrophils transmigrated to ASN (Fig. 4G) compared with blood neutrophils. In vivo, CXCR4 is a surface marker expressed on human neutrophils that plays a role in tissue retention [25] [26] [27] . www.nature.com/scientificreports www.nature.com/scientificreports/ Upon neutrophil transmigration in vitro, CXCR4 was upregulated compared to blood neutrophils (Fig. 4H) . Exploration of the Arg1 and PD-L1 axis demonstrated that Arg1 expression was increased on the cell surface of neutrophils transmigrated to ASN (Fig. 4I) . Neutrophils transmigrated into pooled Day 1 ASN from all patients had decreased PD-L1 surface expression compared to blood neutrophils (Fig. 4J) . However, we did not detect significant differences in Arg1 and PD-L1 expression on blood and airway neutrophils in vivo (data not shown). Experimental controls using negatively selected neutrophils rather than whole blood neutrophils (Fig. E3) and direct incubation of neutrophils with ASN compared with transmigration (Fig. E4 ) did not show significantly  We next compared the respiratory burst capacity of blood neutrophils (Fig. 5A) to that of neutrophils transmigrated toward LTB4 (chemoattractant control) or patient ASN (Fig. 5B) . For blood neutrophils, there was no response at rest or upon fMLF stimulus without initial priming with granulocyte macrophage-colony stimulating factor (GM-CSF), and the burst intensity upon GM-CSF + fMLF treatment was much lower than that seen with the PMA positive control (Fig. 5A ). In contrast, neutrophils transmigrated toward LTB4 or pooled Day 1 ASN from all patients showed an increased respiratory burst intensity to fMLF compared to unstimulated transmigrated neutrophils (Fig. 5B) . Coincubation of neutrophils with pooled Day 1 ASN, without transmigration, for the same duration in serum-free media resulted in stimulation of the respiratory burst with no increase in intensity with addition of fMLF. Neutrophils transmigrated toward ASN was bimodal with a diminished fMLF-stimulated respiratory burst compared with neutrophils transmigrated toward LTB4. Transmigration through the small airway epithelial model primes neutrophils for an increased respiratory burst to fMLF stimulation, similar in intensity to PMA stimulus, compared with blood neutrophils stimulated with GM-CSF (compare Fig. 5A,B) . Next, we compared neutrophils transmigrated to patient ASN with bacterial coinfection (corresponding to high HNE activity) to those transmigrated to patient ASN with no bacterial coinfection (corresponding to low HNE activity). As shown in Fig. 5C ,D, neutrophils transmigrated to ASN from patients with bacterial coinfection had a lower fMLF-stimulated respiratory burst compared to those transmigrated to ASN from patients without bacterial coinfection. Neutrophils transmigrated to ASN from patients without bacterial coinfection had a lower respiratory burst than those transmigrated to LTB4. All conditions led to similar respiratory burst in response to PMA (solid histograms in Fig. 5D ). As seen in the healthy donor blood neutrophils, circulating neutrophils from patients also had low levels of priming as shown by a low respiratory burst with fMLF stimulation compared with PMA. The range of respiratory burst intensity at rest and after fMLF and PMA stimulation is illustrated in Fig. E5A -D, with some patients demonstrating blood neutrophils that are primed to respond to fMLF and some that are not (Fig. E5C,D) . Surface expression of CD16 and CD62L were measured on neutrophils from patient blood obtained within 24 hours of intubation, at rest and following stimulation with fMLF or PMA. Neutrophils that shed CD62L and have high CD16 expression have been previously associated with an immunosuppressive phenotype, while neutrophils with low levels of both CD62L and CD16 are considered immature 14,28-30 . We did not observe elevated percentages of either of these immunosuppressive or immature neutrophil populations in our patients on Days  AsN. We compared surface protein expression of markers in neutrophils transmigrated to HNE-rich and HNE-poor ASN. As shown in Fig. 6A-D, Arg1 , CD63, CD66b were increased and CD16 expression was decreased in neutrophils transmigrated to bacterial coinfected patient ASN versus no bacterial coinfection patient ASN www.nature.com/scientificreports www.nature.com/scientificreports/ ( Fig. 6A-D) . The complete set of surface markers assessed in those two conditions, in comparison with blood neutrophils (pre-transmigration) and with neutrophils transmigrated to LTB4 is shown in Fig. E6 . Finally, we performed bacterial killing assays by neutrophils of H. influenzae and S. aureus, which are PARDS-associated gram-negative and gram-positive bacteria, respectively. Neutrophils transmigrated toward bacterial coinfected ASN showed a lower ability to kill both H. influenzae and S. aureus than those transmigrated to no bacterial coinfection ASN (Fig. 7) . Neutrophils transmigrated toward LTB4 killed H. influenzae with similar efficiency as those transmigrated to HNE-poor ASN, while for S. aureus they were less efficient (Fig. 7) . Blood neutrophils recruited to the lungs of children at risk of or with PARDS due to lower airway viral infections are generally believed to rapidly die therein, leading to the passive release of HNE and other toxic by-products that promote lung injury [31] [32] [33] . In contrast with this conventional paradigm, the findings presented here support the notion that a large population of neutrophils remains viable and undergo profound changes upon recruitment to the airways of these patients. Viable airway neutrophils demonstrated surface mobilization of multiple sets of granules, and lose surface expression of CD16, a key phagocytic receptor. Furthermore, airway neutrophils increased expression of HLA-DR, typically associated with professional antigen-presenting cells, thus reflecting functional changes. To further investigate this process, we adapted an airway inflammation model developed in our group to study diseases of chronic lung inflammation (CF, asthma, COPD) to acute lung inflammatory processes occurring in children with acute respiratory failure due to lower airway infections. This model allowed www.nature.com/scientificreports www.nature.com/scientificreports/ for transepithelial recruitment and pathological conditioning of neutrophils by cell-free patient airway fluid and recapitulated cardinal features of airway neutrophils collected from these patients in vivo. In addition, we identified an association between active HNE exocytosis and bacterial coinfections within 24 hours of endotracheal intubation in these patients and observed that neutrophils recruited to the cell-free airway fluid of patients coinfected with bacteria become deficient in their respiratory burst capacity and in their ability to kill bacteria. HNE is a serine protease contained in primary granules, and elevated levels in bronchoalveolar lavage and plasma are associated with severity of lung injury in ARDS 34 . While extracellular HNE can reflect live neutrophil activation and degranulation, in the tracheal aspirate both necrotic and neutrophils releasing neutrophil extracellular traps (NETs) may also contribute to increased extracellular levels of HNE, thus precluding the use of extracellular HNE activity as a stringent marker of live neutrophil degranulation. Elevated levels of MMP-9 in the lung epithelial lining fluid of patients with ARDS has also been associated with increased severity of lung injury 34, 35 . Primary granule exocytosis in airway compared to blood neutrophils is evidenced by the increase in CD63 expression in addition to decreases in CD16 and CD35 expression as the latter proteins contain HNE and MMP cleavage sites and may also be removed by membrane reuptake 9, 36 . While CD62L downregulation is expected, CD16 expression is generally increased upon transmigration due to degranulation of secretory vesicles www.nature.com/scientificreports www.nature.com/scientificreports/ and tertiary granules 37, 38 ; however, CD16 can be downregulated if endocytosed and cleaved by high activity levels of HNE and MMP-9 16, 36 . Secondary granule exocytosis in airway neutrophils is evidenced by an increase in CD66b expression compared to blood neutrophils. Whether this abnormal activation response can be leveraged therapeutically remains unclear. Indeed, HNE inhibitors, such as sivelestat, have failed to improve mortality in ARDS patients likely due to competing proteases, release of other damage-associated molecular pattern molecules and alarmins, and the immunomodulatory effects of neutrophils on T-cells in the airways of ARDS patients 39 . Significant differences in neutrophil activation markers between the blood and airway compartments observed in our patient population is consistent with prior studies 5, 9, 16, 22, 40 . Our results highlight the importance of studying the airway fluid and cells recruited therein, rather than simply inferring airway neutrophil behavior and function based on cells isolated from blood. Neutrophil priming by agents such as GM-CSF, tumor necrosis factor α or lipopolysaccharide delay apoptosis of neutrophils at sites of inflammation and increase their degranulation and respiratory burst responses to an activating agent 5, 41 . Interestingly, one of the roles assigned to the healthy pulmonary vasculature is to selectively retain primed neutrophils, deprime and release them into the bloodstream 42 . This depriming mechanism may be dysfunctional in ARDS, resulting in release of primed neutrophils into the systemic vasculature that can damage extra-pulmonary organs 42 . Migration of healthy donor neutrophils through our small airway epithelial model primes these neutrophils to undergo a respiratory burst; however, migration to ASN with high NE activity had an attenuated respiratory burst upon fMLF stimulation. The decreased respiratory burst in the presence of HNE-rich ASN from bacterially coinfected patients may serve as rapidly assessed biomarker of bacterial coinfection. The mechanism to explain the poor killing of H. influenzae and S. aureus by neutrophils transmigrated to HNE-rich ASN in our model, which is associated with the clinical outcome of a bacterial coinfection, remains to be explored. An increase in relative Arg1 gene transcript levels has been shown in blood neutrophils from ARDS patients relative to healthy volunteers 5 consistent with our finding of an upregulation in Arg1 surface expression in neutrophils transmigrated to bacterial coinfected ASN. The influence of other immunoregulatory pathways, such as the PD-L1/PD-1 axis, are under investigation as a possible mechanism to explain bacterial coinfection in some children for viral induced respiratory failure. While our transepithelial neutrophil migration model sets up the possibility for controlled studies of the fate of neutrophils in PARDS patients, we acknowledge several limitations. First, we did not perform full functional analyses on primary airway neutrophils due to limited cellular material from patients. Instead, we used cell surface markers of activation as a proxy to inform how well our transepithelial migration model compared to the changes seen in blood and airway neutrophils from patients. In addition, most of our experimental data comes from the transepithelial migration model which recapitulates the small airways -respiratory generation 8 to 16. The tracheal aspirates from the patients were actually collected from airway generation 1 to 2; however, bronchoalveolar lavage of children is not commonly performed unless needed for diagnostic and therapeutic purposes for severe lung injury. Second, we are limited in our ability to collect blood samples from children with a weight under 6 kg or without a central venous or arterial catheter for blood sampling, which made paired comparisons between blood and airway neutrophils from each patient impossible. Nevertheless, despite our limited numbers of patients, we sampled enough patients to identify significant differences in activation and immunomodulatory markers on neutrophils. Although we previously showed differential neutrophil behavior comparing hypertonic saline-induced sputum cells from CF patients and healthy adults 9,16,22 , we were not able to include controls in this study owing to ethical limitations on obtaining non-clinically indicated airway lavage samples on children intubated for elective surgeries. In addition, children intubated for airway protection, rather than for respiratory failure due to a pulmonary cause, do not have neutrophil-rich airway lavage samples making a direct comparison of cellular material impossible to perform. Instead, we focused on serial blood and airway compartment sampling over time in the PICU to profile how neutrophils change such that each patient may act as their own control in future studies. While children in this study ranged in age from 9 days to 16 years, the majority were under 2 years of age limiting comparisons of neutrophil behavior stratified by age. Finally, patients included in this study were infected with a variety of respiratory viruses and due to limited sample size, we cannot determine the effect of any one virus on airway neutrophil behavior or susceptibility to bacterial coinfection. Despite the infectious heterogeneity of our limited number of samples, we were able to detect a significant neutrophil dysfunction signal in the presence of an activated neutrophil environment. In summary, our study highlights phenotypic differences between airway and blood neutrophils in patients at risk of or with PARDS due to lower respiratory tract viral infections with or without bacterial coinfection, emphasizing the need to study compartment-specific behaviors of neutrophils. In addition, we showed that bacterial coinfections on Day 1 of illness may be predicted using markers of neutrophil granule release, immunomodulatory proteins, and metabolic activities, which may inform antimicrobial treatment of patients. Finally, we showcased a novel in vitro transmigration model to study airway neutrophil function following recruitment to and conditioning by patient cell-free airway fluid, laying critical foundations for future mechanistic and therapeutic studies of airway neutrophils in PARDS. The datasets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request.\",\n",
              "  'title': 'Neutrophil Dysfunction in the Airways of Children with Acute Respiratory Failure Due to Lower Respiratory tract Viral and Bacterial Coinfections'}]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 7
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "gp-gRuEc1KBC",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "## Uncomment the lines of below if you want to quickly preview the data using a pandas dataframe\n",
        "## we don't need it here because we will be directly focusing on storing the data in json format\n",
        "## to an Elasticsearch instance on the cloud.\n",
        "\n",
        "## data = pd.DataFrame(working_list)\n",
        "## data.head()"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "3WsUI7q-_GAZ",
        "colab_type": "text"
      },
      "source": [
        "## Connect to an Elasticsearch instance on the Cloud\n",
        "- In order to build the text similary search application, we need a scalable search engine that we can store the embeddings of the text we want to query. We are going to use Elasticsearch on the cloud. The idea is simple: we want to store the dense vectors of the pieces of text from the scholarly articles. In this notebook, we are mostly focusing on storing the embeddings for the body text of the articles. Once we have those stored as embeddings, we can then search using a text query. At query time, the text-based query will also be transformed to an embedding representation and then compared with the embeddings stored in Elasticsearch. We are going to use `cosine similarity` to compare the similarity between the embeddings of the query and the body text stored in Elasticsearch.\n",
        "- First, setup your 14-day free trial acccout on elastic.co using the link: https://www.elastic.co/downloads/\n",
        "- Use the **cloud** option as we want to keep using this online environment. This whole exercise can be replicated on your local machine, but for the purpose of this notebook, we would like to test using the cloud option.\n",
        "- Once you have registered the setup process is relatively easy. You will receive an email and you will use the link provided to setup your cloud instance -- just follow the wizard.\n",
        "- At the end you will have access to an Elasticsearch cloud instance as well as a Kibana instance which we won't use here but can be fun to better understand our data a bit more and create some impressive visualizations using our data.\n",
        "- In your account, you will need to setup a password for your Elasticsearch instance. Generate one and create a `json` file called elastic.json containing your credentials:\n",
        "\n",
        "```json\n",
        "{\n",
        "\"user\": \"elastic\", \n",
        "\"password\": \"<password>\",\n",
        "\"cloud_id\": \"<cloud_id>\"\n",
        "}\n",
        "```\n",
        "\n",
        "- Then you need to upload that json file to this environment similar to what we did with the `kaggle.json` file. Once you have uploaded the file we will access its information using the code below:\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "6ye_6OEHTHpU",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "with open(\"elastic.json\") as elastic_file:\n",
        "    ELASTIC_SETTINGS = json.loads(elastic_file.read().strip())"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "qh9xjjHyTyOg",
        "colab_type": "text"
      },
      "source": [
        "Since we are going to use Elasticsearch to store our data, we need to provide a schema or what we refer to as a `mapping` that tells Elasticsearch how we want to structure the data we are going to store in it. The mapping also specifies the type of the field and their values that we are storing. Elasticsearch is a data storage and will store documents in the `JSON` format. Fortunately, the data already comes in that format so all we need to do is work a bit more on the structuring before sending it over to our Elasticsearch instance. That's what we will focus on in this section.\n",
        "\n",
        "First, let's download to this environment the json files that contain the mapping information that will determine the structure of our data when stored into Elasticsearch:"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "FbTeZQdT1Z_R",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 391
        },
        "outputId": "6b0ffddc-06b1-4540-8404-2345664f1aff"
      },
      "source": [
        "## mappings for our indices\n",
        "!wget https://raw.githubusercontent.com/dair-ai/odsc_2020_nlp/master/articles_index.json -O articles_index.json\n",
        "!wget https://raw.githubusercontent.com/dair-ai/odsc_2020_nlp/master/body_index.json -O body_index.json\n"
      ],
      "execution_count": 13,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "--2020-04-12 12:46:58--  https://raw.githubusercontent.com/dair-ai/odsc_2020_nlp/master/articles_index.json\n",
            "Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...\n",
            "Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.\n",
            "HTTP request sent, awaiting response... 200 OK\n",
            "Length: 826 [text/plain]\n",
            "Saving to: ‘articles_index.json’\n",
            "\n",
            "\rarticles_index.json   0%[                    ]       0  --.-KB/s               \rarticles_index.json 100%[===================>]     826  --.-KB/s    in 0s      \n",
            "\n",
            "2020-04-12 12:46:58 (154 MB/s) - ‘articles_index.json’ saved [826/826]\n",
            "\n",
            "--2020-04-12 12:47:01--  https://raw.githubusercontent.com/dair-ai/odsc_2020_nlp/master/body_index.json\n",
            "Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...\n",
            "Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.\n",
            "HTTP request sent, awaiting response... 200 OK\n",
            "Length: 538 [text/plain]\n",
            "Saving to: ‘body_index.json’\n",
            "\n",
            "body_index.json     100%[===================>]     538  --.-KB/s    in 0s      \n",
            "\n",
            "2020-04-12 12:47:01 (101 MB/s) - ‘body_index.json’ saved [538/538]\n",
            "\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7jEOCmOYbehn",
        "colab_type": "text"
      },
      "source": [
        "Now install the Pythom Elasticsearch client:"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "0zL--DvB_WbY",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 139
        },
        "outputId": "51f0fb69-b28d-4259-c803-7e6681c2163b"
      },
      "source": [
        "!pip install elasticsearch"
      ],
      "execution_count": 14,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Collecting elasticsearch\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/cc/cf/7973ac58090b960857da04add0b345415bf1e1741beddf4cbe136b8ad174/elasticsearch-7.6.0-py2.py3-none-any.whl (88kB)\n",
            "\r\u001b[K     |███▊                            | 10kB 24.5MB/s eta 0:00:01\r\u001b[K     |███████▍                        | 20kB 6.0MB/s eta 0:00:01\r\u001b[K     |███████████                     | 30kB 8.5MB/s eta 0:00:01\r\u001b[K     |██████████████▉                 | 40kB 5.5MB/s eta 0:00:01\r\u001b[K     |██████████████████▌             | 51kB 6.7MB/s eta 0:00:01\r\u001b[K     |██████████████████████▏         | 61kB 7.9MB/s eta 0:00:01\r\u001b[K     |█████████████████████████▉      | 71kB 9.0MB/s eta 0:00:01\r\u001b[K     |█████████████████████████████▋  | 81kB 10.1MB/s eta 0:00:01\r\u001b[K     |████████████████████████████████| 92kB 6.5MB/s \n",
            "\u001b[?25hRequirement already satisfied: urllib3>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from elasticsearch) (1.24.3)\n",
            "Installing collected packages: elasticsearch\n",
            "Successfully installed elasticsearch-7.6.0\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "DNyZDhk-bj2P",
        "colab_type": "text"
      },
      "source": [
        "The code block below is used to create a client connection to your Elasticsearch instance on the cloud. Remember that `elastic.json` that holds the credentional information, we will use it here:"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "NEJ_I4pO-r6T",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "from elasticsearch import Elasticsearch\n",
        "from elasticsearch import helpers\n",
        "\n",
        "es = Elasticsearch(\n",
        "    cloud_id=ELASTIC_SETTINGS[\"cloud_id\"],\n",
        "    http_auth=(ELASTIC_SETTINGS[\"user\"], ELASTIC_SETTINGS[\"password\"]),\n",
        ")"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "4fK5-IiuAsT7",
        "colab_type": "text"
      },
      "source": [
        "## Load TensorFlow Pretrained Model\n",
        "We are interested to use sentence embeddings techniques to embed the scholarly texts. We will use the [Universal Sentence Encoder](https://tfhub.dev/google/universal-sentence-encoder-large/5) from TensorFlow Hub. You can use any pretrained models that can be used to produce the representations such as Hugging Face Transformers, etc. Load the pretrained model:"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "FLfWIE8x_07W",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "embed = hub.load(\"https://tfhub.dev/google/universal-sentence-encoder-large/5\")"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "sL36MNRFdh9R",
        "colab_type": "text"
      },
      "source": [
        "Let's generate embeddings for a piece of abstract as an example. "
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "IvzLzC3bARar",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 54
        },
        "outputId": "30bde0bc-1bc4-49c6-f099-36f15f56b667"
      },
      "source": [
        "sample_doc = working_list[0]['abstract'][0]\n",
        "print(sample_doc)"
      ],
      "execution_count": 25,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Fusion between the viral and target cell membranes is an obligatory step for the infectivity of all enveloped virus, and blocking this process is a clinically validated therapeutic strategy. Viral fusion is driven by specialized proteins which, although specific to each virus, act through a common mechanism, the formation of a complex between two heptad repeat (HR) regions. The HR regions are initially separated in an intermediate termed ''prehairpin'', which bridges the viral and cell membranes, and then fold onto each other to form a 6-helical bundle (6HB), driving the two membranes to fuse. HR-derived peptides can inhibit viral infectivity by binding to the prehairpin intermediate and preventing its transition to the 6HB. The antiviral activity of HR-derived peptides differs considerably among enveloped viruses. For weak inhibitors, potency can be increased by peptide engineering strategies, but sequence-specific optimization is time-consuming. In seeking ways to increase potency without changing the native sequence, we previously reported that attachment to the HR peptide of a cholesterol group (''cholesterol-tagging'') dramatically increases its antiviral potency, and simultaneously increases its halflife in vivo. We show here that antiviral potency may be increased by combining cholesterol-tagging with dimerization of the HR-derived sequence, using as examples human parainfluenza virus, Nipah virus, and HIV-1. Together, cholesteroltagging and dimerization may represent strategies to boost HR peptide potency to levels that in some cases may be compatible with in vivo use, possibly contributing to emergency responses to outbreaks of existing or novel viruses.\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "f5QiKnfXAOem",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        },
        "outputId": "fce3cf6b-6a54-4929-84c5-967cd2b9ab97"
      },
      "source": [
        "embeddings = embed([sample_doc])\n",
        "print(embeddings.shape)"
      ],
      "execution_count": 26,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "(1, 512)\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "d0YwUsTDdrhY",
        "colab_type": "text"
      },
      "source": [
        "You can see that the embedding generated for the piece of text is of size (1, 512). These vector representation will be stored into Elasticsearch using a `dense_vector` type including the original pieces of text."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "KGxFQQIyAxNd",
        "colab_type": "text"
      },
      "source": [
        "## Index Sentence Embeddings into Elasticsearch\n",
        "In this section, we will finally be indexing/storing the documents into Elasticsearch. This will be done in batches and via the client we set up before. A few settings first:"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "7PSD_bsfBU-2",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "ARTICLE_INDEX_NAME = \"covid_articles\"\n",
        "ARTICLE_INDEX_FILE = \"articles_index.json\"\n",
        "\n",
        "BODY_INDEX_NAME = \"body_vectors\"\n",
        "BODY_INDEX_FILE = \"body_index.json\"\n",
        "\n",
        "BATCH_SIZE = 1000\n",
        "SEARCH_SIZE = 10"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "mZsK8DcmAl_O",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "## Function to embed text\n",
        "def embed_text(text):\n",
        "    vectors = embed(text)\n",
        "    return [vector.numpy().tolist() for vector in vectors]"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "nzTq9mMfBh4U",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "## docs format:\n",
        "## [{abstract: [...], \"body_text\": [...], title: \"\", path: \"\", \"paper_id\":\"\", \"text\":\"\"},\n",
        "##  {abstract: [...], \"body_text\": [...], title: \"\", path: \"\", \"paper_id\":\"\", \"text\":\"\"},\n",
        "##  ...]\n",
        "\n",
        "## Function to index abstracts/body paragraphs and their vector representations\n",
        "def index_batch_vectors(docs, field, index_name):\n",
        "    requests = []\n",
        "\n",
        "    ## index body vectors for every document in batch\n",
        "    for i, doc in enumerate(docs):\n",
        "        paragraphs = []\n",
        "        \n",
        "        for text in doc[field]:\n",
        "            paragraphs.append(text)\n",
        "\n",
        "        ## TODO: Embed individually below so as to avoid OOM error\n",
        "        vectors = embed_text(paragraphs)\n",
        "\n",
        "        for j, t in enumerate(doc[field]):\n",
        "            request = {\"_op_type\": \"index\", \n",
        "                       \"_index\": index_name,\n",
        "                       field+\"_vector\": vectors[j],\n",
        "                       field: paragraphs[j],\n",
        "                       \"paper_id\": doc[\"paper_id\"]}\n",
        "            requests.append(request)\n",
        "    helpers.bulk(es, requests)\n",
        "\n",
        "def index_batch(docs):\n",
        "    ## uncomment both lines to embed titles\n",
        "    titles = [doc[\"title\"] for doc in docs]\n",
        "    title_vectors = embed_text(titles)\n",
        "\n",
        "    requests = []\n",
        "    for i, doc in enumerate(docs):\n",
        "        request = doc\n",
        "        request[\"_op_type\"] = \"index\"\n",
        "        request[\"_index\"] = ARTICLE_INDEX_NAME\n",
        "        request[\"title_vector\"] = title_vectors[i]\n",
        "        requests.append(request)\n",
        "    helpers.bulk(es, requests)\n",
        "\n",
        "    ## index body vectors\n",
        "    index_batch_vectors(docs, \"body_text\", BODY_INDEX_NAME)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "nz98qg2NffhU",
        "colab_type": "text"
      },
      "source": [
        "In the function directly above (`index_batch`), we are indexing the original scholarly text into an index called `covid_articles`. This includes all the text fields and the embedding of the titles. \n",
        "\n",
        "We would also need to index the embeddings for the individual abstract segments and body text segments. Remember that unlike the title, abstracts and the body text can include more that one paragraph or piece of text which means that we need to store these seperately. For this, we created a function above called `index_batch_vectors` that produces the embeddings for each paragraph in the body text of abstract. These will then be stored seperately into an index called `body_vectors` since in the example above we are mostly interested in the body of the article and its paragraphs. \n",
        "\n",
        "As an exercise, you can reuse the function to do the same for all the abstracts but you may need to create another index to store these. Remember that an index in Elasticsearch is a collection of documents that have similar properties so it makes sense to seperate these collections of documents in seperate indices. In essenence, if you want to retrieve or search on the orginal text use the `covid_articles` index and if you are interested in query in the individual body paragraph, which we will do below, you search on the `body_vectors` index.\n",
        "\n",
        "Let's implement one more function to create the indices and start the batch processing to index the articles into Elasticsearch:"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "l5H6ROk6B2AM",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "## index data in batches\n",
        "def index_data(article):\n",
        "   \n",
        "    with open(ARTICLE_INDEX_FILE) as index_file:\n",
        "        source = index_file.read().strip()\n",
        "        es.indices.create(index=ARTICLE_INDEX_NAME, body=source)\n",
        "    \n",
        "    with open(BODY_INDEX_FILE) as index_file:\n",
        "        source = index_file.read().strip()\n",
        "        es.indices.create(index=BODY_INDEX_NAME, body=source)\n",
        "\n",
        "    docs = []\n",
        "    count = 0\n",
        "\n",
        "    for line in article:\n",
        "        #print (line)\n",
        "        #doc = json.loads(line))\n",
        "        docs.append(line)\n",
        "        count += 1\n",
        "\n",
        "        if count % BATCH_SIZE == 0:\n",
        "            index_batch(docs)\n",
        "            docs = []\n",
        "            print(\"Indexed {} documents.\".format(count))\n",
        "            \n",
        "    if docs:\n",
        "        index_batch(docs)\n",
        "        print(\"Indexed {} documents.\".format(count))\n",
        "\n",
        "    es.indices.refresh(index=ARTICLE_INDEX_NAME)\n",
        "    print(\"Done indexing.\")"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "yVRr9vgGhVtU",
        "colab_type": "text"
      },
      "source": [
        "And finally, let's run the indexing operation by running the code below. We have selected 2000 articles, to avoid waiting to long. If you have the time, you can choose to index all the articles. \n",
        "\n",
        "Note that if you choose to store all articles it will take a longer time and you may run into an OOM error. It's a simple fix but I will leave this as an exercise. I have provided a hint in the `index_batch_vectors` function above indicated by a `TODO` tag. The issue is that this environment doesn't allow for tensors bigger than a specific size, which does happen in one of our batches.\n",
        "\n",
        "If you don't want that error, just run the code below. I will provide the fix later."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "odnYirAPCuFr",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 68
        },
        "outputId": "b7ad7b60-205f-4f9d-97f7-52198cfc0681"
      },
      "source": [
        "index_data(working_list[0:2000])"
      ],
      "execution_count": 36,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Indexed 1000 documents.\n",
            "Indexed 2000 documents.\n",
            "Done indexing.\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "OvABA_fjljrT",
        "colab_type": "text"
      },
      "source": [
        "## Text Similarity Search\n",
        "If the indexing above finished successfully, we are now ready to test text similarity using the embeddings we have stored into Elasticsearch. \n",
        "\n",
        "Elasticsearch has a very rich API that allows very different types of search. Here we are going to focus on a simple search scenario.\n",
        "\n",
        "First, we are going to ask the user to input a query. The query will then be encoded into its dense vector representation using the same pretrained model from TensorFlow. Then we will perform a query in Elasticsearch with the goal to search for similar body text by performing a cosine similarity on the body text vectors and the query vector:\n",
        "\n",
        "```python\n",
        "script_query = {\n",
        "    \"script_score\": {\n",
        "        \"query\": {\"match_all\": {}},\n",
        "        \"script\": {\n",
        "            \"source\": \"cosineSimilarity(params.query_vector, doc['body_text_vector']) + 1.0\",\n",
        "            \"params\": {\"query_vector\": query_vector}\n",
        "        }\n",
        "    }\n",
        "}\n",
        "```\n",
        "\n",
        "If you would like to know more about these Elasticsearch functionalities, feel free to check our [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-query.html#script-query-ex-request) for further details. Further understanding of Elasticsearch is left as an excerise and is out of scope for this tutorial"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "iERjNMlUlkxG",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "## Function to handle the query\n",
        "\n",
        "def run_query_loop():\n",
        "    while True:\n",
        "        try:\n",
        "            handle_query()\n",
        "        except KeyboardInterrupt:\n",
        "            return\n",
        "\n",
        "            \n",
        "def handle_query():\n",
        "    query = input(\"Enter query: \")\n",
        "\n",
        "    embedding_start = time.time()\n",
        "    query_vector = embed_text([query])[0]\n",
        "    embedding_time = time.time() - embedding_start\n",
        "\n",
        "    script_query = {\n",
        "        \"script_score\": {\n",
        "            \"query\": {\"match_all\": {}},\n",
        "            \"script\": {\n",
        "                \"source\": \"cosineSimilarity(params.query_vector, doc['body_text_vector']) + 1.0\",\n",
        "                \"params\": {\"query_vector\": query_vector}\n",
        "            }\n",
        "        }\n",
        "    }\n",
        "\n",
        "    search_start = time.time()\n",
        "    response = es.search(\n",
        "        index=BODY_INDEX_NAME,\n",
        "        body={\n",
        "            \"size\": SEARCH_SIZE,\n",
        "            \"query\": script_query,\n",
        "            \"_source\": {\"includes\": [\"paper_id\", \"body_text\"]}\n",
        "        }\n",
        "    )\n",
        "    search_time = time.time() - search_start\n",
        "\n",
        "    print()\n",
        "    print(\"{} total hits.\".format(response[\"hits\"][\"total\"][\"value\"]))\n",
        "    print(\"embedding time: {:.2f} ms\".format(embedding_time * 1000))\n",
        "    print(\"search time: {:.2f} ms\".format(search_time * 1000))\n",
        "    for hit in response[\"hits\"][\"hits\"]:\n",
        "        print(\"id: {}, score: {}\".format(hit[\"_id\"], hit[\"_score\"]))\n",
        "        print(hit[\"_source\"])\n",
        "        print()"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "6y5GwRrck31H",
        "colab_type": "text"
      },
      "source": [
        "You are now ready to enjoy your search application. Run the code below and input your phrase to search for:"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "PwZ1zOxil56y",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 650
        },
        "outputId": "52ba1214-70d0-4c32-e6ee-b24b4df434dc"
      },
      "source": [
        "run_query_loop()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Enter query: herbal treatment\n",
            "\n",
            "10000 total hits.\n",
            "embedding time: 22.38 ms\n",
            "search time: 1232.09 ms\n",
            "id: qtiSbnEBtvu42qbNUfex, score: 1.9520377\n",
            "{'body_text': 'Herbal treatments', 'paper_id': 'b9f617f6229dcea28f092bc9fa9c2bbe3c8e9b81'}\n",
            "\n",
            "id: a9mTbnEBtvu42qbN2x5K, score: 1.437657\n",
            "{'body_text': 'Geranium macrorrhizum herb ----', 'paper_id': 'f8c2f1a1903f8370c15b5be2e4d32e91f2641b03'}\n",
            "\n",
            "id: mdmTbnEBtvu42qbN2x1J, score: 1.4076636\n",
            "{'body_text': 'Anti-inflammatory', 'paper_id': '8c73602b18bc6b2fb17e8f37552995f6e310c6fd'}\n",
            "\n",
            "id: ctmTbnEBtvu42qbN2x5K, score: 1.396433\n",
            "{'body_text': 'Echinacea purpurea herb + ---', 'paper_id': 'f8c2f1a1903f8370c15b5be2e4d32e91f2641b03'}\n",
            "\n",
            "id: hNmTbnEBtvu42qbN2x1J, score: 1.3913385\n",
            "{'body_text': 'The use of traditional medicine is still deep ingrained in some cultures even today; therefore thousands of people rely on the therapeutic potential of plants for treating certain diseases in their daily lives [76] [77] [78] [79] . Benefits from of this kind of therapy are not unexpected, since natural products have always been an ample source of new medical compounds [80] . Due to its phytochemical composition, rose hip is an interesting therapeutic option for those disorders which involve oxidative stress and/or a pro-inflammatory status.', 'paper_id': '8c73602b18bc6b2fb17e8f37552995f6e310c6fd'}\n",
            "\n",
            "id: QdmUbnEBtvu42qbNEig-, score: 1.3793337\n",
            "{'body_text': 'A total of 15 treatments were selected for the bioassay and were the d 0 post-inoculation: 1) negative control with no PEDV and no mitigant treatment; or 2) positive control with PEDV and no chemical treatment; or from d 1 post-inoculation: 3) positive control with PEDV and no chemical treatment; 4) 0.325% commercial-based formaldehyde; 5) 1% MCFA non-aerosolized; 6) 0.66% caproic acid; 7) 0.66% caprylic acid; 8) 0.66% capric acid; 9) 0.66% lauric acid; 10) 0.3% FRA C12; 11) 1% canola oil; 12) 1% choice white grease; 13) 1% coconut oil; 14) 1% palm kernel oil; 15) 1% soy oil.', 'paper_id': '74ae1ca5cc1f7ae981ab9263bea4f00444bb872c'}\n",
            "\n",
            "id: 9dmTbnEBtvu42qbNFg0b, score: 1.3606257\n",
            "{'body_text': 'However, most of the cultivation, harvesting and processing management procedures of Chinese herbal medicinal materials are extensive. There is a lack of relevant technological innovations, the production process is not well scientifically based, the yield per unit area is low, the quality of the herbs is uneven, and the classification of species is not strictly enforced. There are no effective means to manage and resolve the problems of pesticide residues during pest control, and heavy metal residues occur through the process of planting, leading to the existence of unwanted chemicals in the herbs [34] . There are only a few quality control indicators for most of Chinese medicinal materials, and some of them have no quantitative indicators and even no qualitative indicators. Currently, the majority of the existing Chinese medicinal materials quality control specifications are not effectively to ensure the stable quality of Chinese medicinal materials, and the medicinal ingredients in these materials, which are the most direct causes for the unstable quality of TCM and the unevenness of its clinical efficacy [34] .', 'paper_id': '9be783afc22075545d893250f5c7f1ef7317cf37'}\n",
            "\n",
            "id: btmTbnEBtvu42qbN2x5K, score: 1.359945\n",
            "{'body_text': 'roots ----', 'paper_id': 'f8c2f1a1903f8370c15b5be2e4d32e91f2641b03'}\n",
            "\n",
            "id: ZtmTbnEBtvu42qbN2x5K, score: 1.354683\n",
            "{'body_text': 'Chamaemelum nobile herb + ---', 'paper_id': 'f8c2f1a1903f8370c15b5be2e4d32e91f2641b03'}\n",
            "\n",
            "id: 7dmTbnEBtvu42qbNFg0b, score: 1.351991\n",
            "{'body_text': \"China has rich natural medicine resources, with the world's largest treasure of Chinese herbal medicine, and [27] . At present, domestic cultivation is a widely used and generally accepted practice in China. Cultivation provides the opportunity to use new techniques to solve problems encountered in the production of medicinal plants, such as toxic components, pesticide contamination, low contents of active ingredients, and the misidentification of botanical origin. Cultivation under controlled growth conditions can improve the yields of bioactive components and obtain improved yields of target products [28] .\", 'paper_id': '9be783afc22075545d893250f5c7f1ef7317cf37'}\n",
            "\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "6Xw7pfPRlM1q",
        "colab_type": "text"
      },
      "source": [
        "## References:\n",
        "\n",
        "- [Elastic Stack and Product Documentation](https://www.elastic.co/guide/index.html)\n",
        "- [CORD-19 Dataset](https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challenge)\n",
        "- [transmission, incubation, and stability by Souvik](https://www.kaggle.com/souviksbhowmik/transmission-incubation-and-stability-by-souvik)\n",
        "- [TensorFlow Hub](https://tfhub.dev/google/universal-sentence-encoder-large/5)\n",
        "- [Text Similarity Search in Elasticsearch (blog)](https://www.elastic.co/blog/text-similarity-search-with-vectors-in-elasticsearch)\n",
        "- [Text Embeddings in Elasticsearch](https://github.com/jtibshirani/text-embeddings)"
      ]
    }
  ]
}
